Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 4dfcea1

Browse files
author
Will Anderson
committed
Merge pull request #11 from Microsoft/download-error-checking
Add an error check to the update download function
2 parents 62b47e8 + 0f7525a commit 4dfcea1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

package-mixins.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ var extend = require("extend");
33
module.exports = (NativeCodePush) => {
44
var remote = {
55
download: function download() {
6+
if (!this.downloadUrl) {
7+
return Promise.reject(new Error("Cannot download an update without a download url"));
8+
}
9+
610
// Use the downloaded package info. Native code will save the package info
711
// so that the client knows what the current package version is.
812
return NativeCodePush.downloadUpdate(this)

0 commit comments

Comments
 (0)