diff --git a/package-lock.json b/package-lock.json index 1fb3cfe..3ed8c80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@codearts/core", - "version": "0.4.3", + "version": "0.4.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@codearts/core", - "version": "0.4.3", + "version": "0.4.4", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@cloudide/messaging": "^0.1.0", diff --git a/package.json b/package.json index ce5319f..3e96054 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "codearts", "plugin" ], - "version": "0.4.3", + "version": "0.4.4", "license": "SEE LICENSE IN LICENSE", "description": "core plugin api of cloudide frontend and backend", "repository": { diff --git a/src/node/plugin-api.ts b/src/node/plugin-api.ts index 8c9cc86..4fe335f 100644 --- a/src/node/plugin-api.ts +++ b/src/node/plugin-api.ts @@ -214,9 +214,11 @@ export class Plugin { public dispatchMessage(sourceViewType: string, message: any): void { this.container.forEach(async (webviewContainer, viewType) => { - if (viewType !== sourceViewType) { + if (viewType !== sourceViewType && !webviewContainer.disposed) { await webviewContainer.pageInitialized.promise; - webviewContainer.postMessage(message); + if (!webviewContainer.disposed) { + webviewContainer.postMessage(message); + } } }); }