From cbb8431cfc08ce3746bdb6733057aded710bc0d9 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 24 Apr 2018 14:01:43 +0200 Subject: [PATCH] fix after rebase --- .../owncloud/android/jobs/MediaFoldersDetectionJob.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/owncloud/android/jobs/MediaFoldersDetectionJob.java b/src/main/java/com/owncloud/android/jobs/MediaFoldersDetectionJob.java index 439b51e9f4..8710dcbf2b 100644 --- a/src/main/java/com/owncloud/android/jobs/MediaFoldersDetectionJob.java +++ b/src/main/java/com/owncloud/android/jobs/MediaFoldersDetectionJob.java @@ -152,7 +152,7 @@ public class MediaFoldersDetectionJob extends Job { NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.notification_icon) .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.notification_icon)) - .setColor(ThemeUtils.primaryColor()) + .setColor(ThemeUtils.primaryColor(getContext())) .setSubText(account.name) .setContentTitle(contentTitle) .setContentText(subtitle) @@ -167,7 +167,8 @@ public class MediaFoldersDetectionJob extends Job { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.notify(0, notificationBuilder.build()); + if (notificationManager != null) { + notificationManager.notify(0, notificationBuilder.build()); + } } - }