diff --git a/src/android/com/pchab/android/plugin/Downloader.java b/src/android/com/pchab/android/plugin/Downloader.java index 75e7bdc..dc5f657 100644 --- a/src/android/com/pchab/android/plugin/Downloader.java +++ b/src/android/com/pchab/android/plugin/Downloader.java @@ -135,6 +135,9 @@ public void onReceive( Context context, Intent intent) { //Retrieve the saved download Download currentDownload = downloadMap.get(downloadId); downloadMap.remove(downloadId); + if(currentDownload == null || currentDownload.callbackContext == null) { + return; + } int columnIndex = cursor.getColumnIndex(DownloadManager.COLUMN_STATUS); int status = cursor.getInt(columnIndex);