mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-20 23:05:15 +03:00
Avoid exceptions when serial break or overruns occur without info
object.
This commit is contained in:
parent
ebd77db93f
commit
d319132135
1 changed files with 16 additions and 14 deletions
|
@ -77,6 +77,7 @@ var serial = {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
chrome.serial.setPaused(info.connectionId, false, function() {
|
chrome.serial.setPaused(info.connectionId, false, function() {
|
||||||
self.getInfo(function (info) {
|
self.getInfo(function (info) {
|
||||||
|
if (info) {
|
||||||
if (info.paused) {
|
if (info.paused) {
|
||||||
// assume unrecoverable, disconnect
|
// assume unrecoverable, disconnect
|
||||||
console.log('SERIAL: Connection did not recover from ' + self.error + ' condition, disconnecting');
|
console.log('SERIAL: Connection did not recover from ' + self.error + ' condition, disconnecting');
|
||||||
|
@ -93,6 +94,7 @@ var serial = {
|
||||||
console.log('SERIAL: Connection recovered from ' + self.error + ' condition');
|
console.log('SERIAL: Connection recovered from ' + self.error + ' condition');
|
||||||
googleAnalytics.sendException('Serial: ' + self.error + ' - recovered', false);
|
googleAnalytics.sendException('Serial: ' + self.error + ' - recovered', false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 50);
|
}, 50);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue