Skip to content

Commit

Permalink
fix: reject also getLatest is message present
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed May 26, 2023
1 parent 4be4474 commit cf538a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,9 @@ public void run() {
if (res.has("error")) {
call.reject(res.getString("error"));
return;
} else if (res.has("message")) {
call.reject(res.getString("message"));
return;
} else {
call.resolve(res);
}
Expand Down
2 changes: 2 additions & 0 deletions ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
let res = self.implementation.getLatest(url: URL(string: self.updateUrl)!)
if res.error != nil {
call.reject( res.error!)
} else if res.message != nil {
call.reject( res.message!)
} else {
call.resolve(res.toDict())
}
Expand Down

0 comments on commit cf538a1

Please sign in to comment.