Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Added error checks to the auto update mechanism. So in case the auto …
Browse files Browse the repository at this point in the history
…update mechansim fails, we will now give chance to the default update process Handler to handle the update mechanism (Which is essentially taking the user to brackets.io). (#14605)
  • Loading branch information
nethip authored and swmitra committed Dec 3, 2018
1 parent 488edaf commit 7479c03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/extensions/default/AutoUpdate/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,12 @@ define(function (require, exports, module) {

} else {
// Update not present for current platform
return;
return false;
}

if (!checksum || !downloadURL || !installerName) {
console.warn("AutoUpdate : asset information incorrect for the update");
return;
return false;
}

var updateParams = {
Expand Down
7 changes: 6 additions & 1 deletion src/utils/UpdateNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,12 @@ define(function (require, exports, module) {
*/
function handleUpdateProcess(updates) {
var handler = _updateProcessHandler || _defaultUpdateProcessHandler;
handler(updates);
var success = handler(updates);
if (_updateProcessHandler && !success) {
// Give a chance to default handler in case
// the auot update mechanism has failed.
_defaultUpdateProcessHandler(updates);
}
}

/**
Expand Down

0 comments on commit 7479c03

Please sign in to comment.