mirror of
https://github.com/zoriya/react-native-background-downloader.git
synced 2026-05-29 16:52:08 +00:00
downloadTask: set metadata only if it was parsed correctly;
This commit is contained in:
+3
-1
@@ -21,7 +21,9 @@ export default class DownloadTask {
|
||||
this.bytesWritten = taskInfo.bytesWritten ?? 0
|
||||
this.totalBytes = taskInfo.totalBytes ?? 0
|
||||
|
||||
this.metadata = this.tryParseJson(taskInfo.metadata)
|
||||
const metadata = this.tryParseJson(taskInfo.metadata)
|
||||
if (metadata)
|
||||
this.metadata = metadata
|
||||
|
||||
if (originalTask) {
|
||||
this.beginHandler = originalTask.beginHandler
|
||||
|
||||
Reference in New Issue
Block a user