mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 18:28:59 +03:00
Merge pull request #6721 from grote/6719-npe-onTransferProgress
Prevent NPE: Ensure that mNotificationManager is not null
This commit is contained in:
commit
ee075f285c
1 changed files with 3 additions and 0 deletions
|
@ -715,6 +715,9 @@ public class FileUploader extends Service
|
|||
String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1);
|
||||
String text = String.format(getString(R.string.uploader_upload_in_progress_content), percent, fileName);
|
||||
mNotificationBuilder.setContentText(text);
|
||||
if (mNotificationManager == null) {
|
||||
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
}
|
||||
mNotificationManager.notify(R.string.uploader_upload_in_progress_ticker, mNotificationBuilder.build());
|
||||
}
|
||||
mLastPercent = percent;
|
||||
|
|
Loading…
Reference in a new issue