From 0e89b270cc87bb9112498e9a8e34905967c2b447 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Fri, 26 Mar 2021 18:12:25 +0800 Subject: [PATCH] Check download listener --- .../java/cn/reactnative/modules/update/DownloadTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java index 72fae4c..9307884 100644 --- a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java +++ b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java @@ -529,7 +529,10 @@ class DownloadTask extends AsyncTask { break; } Log.e("pushy", "download task failed", e); - params[0].listener.onDownloadFailed(e); + + if (params[0].listener != null) { + params[0].listener.onDownloadFailed(e); + } } return null; }