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

Commit fc2ebbe

Browse files
committed
Added error checks to the auto update mechanism. So in case the auto 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)
1 parent cca4422 commit fc2ebbe

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/extensions/default/AutoUpdate/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,12 +486,12 @@ define(function (require, exports, module) {
486486

487487
} else {
488488
// Update not present for current platform
489-
return;
489+
return false;
490490
}
491491

492492
if (!checksum || !downloadURL || !installerName) {
493493
console.warn("AutoUpdate : asset information incorrect for the update");
494-
return;
494+
return false;
495495
}
496496

497497
var updateParams = {

src/utils/UpdateNotification.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,12 @@ define(function (require, exports, module) {
512512
*/
513513
function handleUpdateProcess(updates) {
514514
var handler = _updateProcessHandler || _defaultUpdateProcessHandler;
515-
handler(updates);
515+
var success = handler(updates);
516+
if (_updateProcessHandler && !success) {
517+
// Give a chance to default handler in case
518+
// the auot update mechanism has failed.
519+
_defaultUpdateProcessHandler(updates);
520+
}
516521
}
517522

518523
/**

0 commit comments

Comments
 (0)