1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

catch some runtime errors in current context

This commit is contained in:
cTn 2014-09-22 21:16:52 +02:00
parent 2088a49b15
commit 177498bd20

View file

@ -48,9 +48,13 @@ function configuration_backup() {
// create or load the file
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight_backup_' + now, accepts: accepts}, function (fileEntry) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
if (!fileEntry) {
console.log('No file selected, backup aborted.');
return;
}
@ -127,9 +131,13 @@ function configuration_restore() {
// load up the file
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: accepts}, function (fileEntry) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
if (!fileEntry) {
console.log('No file selected, restore aborted.');
return;
}