Skip to content

Commit 785dcfb

Browse files
committed
Fixed handling of unexpected problems in the Flow with the main process becoming disconnected.
1 parent 39b7e19 commit 785dcfb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- framework reads a `/config` file in `plugins`
77
- added `RESTBuilder.?.logerror()` method for printing errors into the console
88
- added `API.?.logerror()` method for printing errors into the console
9+
- fixed handling of unexpected problems in the Flow with the main process becoming disconnected
910

1011
========================
1112
0.0.15

flow-flowstream.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ Instance.prototype = {
9797
};
9898

9999
Instance.prototype.postMessage = function(msg) {
100-
this.flow.postMessage && this.flow.postMessage(msg);
100+
if (this.flow.postMessage) {
101+
// Try & Catch handles unexpected problems with the main process becoming disconnected.
102+
try {
103+
this.flow.postMessage(msg);
104+
} catch {}
105+
}
101106
};
102107

103108
Instance.prototype.httprequest = function(opt, callback) {

0 commit comments

Comments
 (0)