electrobun 0.3.0-beta.0 → 0.3.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -97,14 +97,25 @@ const startRPCServer = () => {
97
97
  }
98
98
  },
99
99
  close(ws, code, reason) {
100
+ if (!ws?.data) {
101
+ return;
102
+ }
100
103
  const { webviewId } = ws.data;
101
104
  console.log("Closed:", webviewId, code, reason);
102
- socketMap[webviewId].socket = null;
105
+ if (socketMap[webviewId]) {
106
+ socketMap[webviewId].socket = null;
107
+ }
103
108
  },
104
109
 
105
110
  message(ws, message) {
111
+ if (!ws?.data) {
112
+ return;
113
+ }
106
114
  const { webviewId } = ws.data;
107
115
  const browserView = BrowserView.getById(webviewId);
116
+ if (!browserView) {
117
+ return;
118
+ }
108
119
 
109
120
  if (browserView.rpcHandler) {
110
121
  if (typeof message === "string") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.3.0-beta.0",
3
+ "version": "0.3.1-beta.0",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",