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

Commit 2811f51

Browse files
Merge pull request #541 from telerik/vladimirov/fix-future-resolved-more-than-once
Prevent Future resolved more than once errors
2 parents dae8c83 + e971775 commit 2811f51

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mobile/ios/ios-core.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ export class GDBServer implements Mobile.IGDBServer {
12131213
clearInterval(timer);
12141214
}
12151215

1216-
if (!retryCount) {
1216+
if (!retryCount && !future.isResolved()) {
12171217
future.throw(new Error("Unable to kill the application."));
12181218
}
12191219
}, 1000);
@@ -1225,7 +1225,9 @@ export class GDBServer implements Mobile.IGDBServer {
12251225
isDataReceived = true;
12261226
this.socket.removeListener("data", dataCallback);
12271227
clearInterval(timer);
1228-
future.return(data.toString());
1228+
if(!future.isResolved()) {
1229+
future.return(data.toString());
1230+
}
12291231
}
12301232
};
12311233

0 commit comments

Comments
 (0)