Commit de3a749b by olly Committed by Oliver Woodman

Fix scheduler NPE in DownloadService

PiperOrigin-RevId: 230260266
parent 29711b92
......@@ -65,7 +65,7 @@ public class DemoDownloadService extends DownloadService {
@Override
protected void onDownloadStateChanged(DownloadState downloadState) {
Notification notification = null;
Notification notification;
if (downloadState.state == DownloadState.STATE_COMPLETED) {
notification =
DownloadNotificationUtil.buildDownloadCompletedNotification(
......
......@@ -462,7 +462,7 @@ public abstract class DownloadService extends Service {
public void detachService(DownloadService downloadService, boolean unschedule) {
Assertions.checkState(this.downloadService == downloadService);
this.downloadService = null;
if (unschedule) {
if (scheduler != null && unschedule) {
scheduler.cancel();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment