fix puterjs throwing errors after consuming message events not meant for it (#1612)

This commit is contained in:
velzie
2025-09-25 14:11:34 -04:00
committed by GitHub
parent 72ee05fefb
commit 8b9fefa4a2
2 changed files with 2 additions and 1 deletions

View File

@@ -275,6 +275,7 @@ class UI extends EventListener {
// Bind the message event listener to the window
let lastDraggedOverElement = null;
(globalThis.document) && window.addEventListener('message', async (e) => {
if (!e.data) return;
// `error`
if(e.data.error){
throw e.data.error;

View File

@@ -20,7 +20,7 @@ export class XDIncomingService extends putility.concepts.Service {
}
const data = event.data;
if ( ! data ) return;
const tag = data.$;
if ( ! tag ) return;
if ( ! this.tagged_listeners_[tag] ) return;