fix: guard scene director callbacks

This commit is contained in:
dufferdeepu committed 2026-10-17 19:17:52 +05:30
1 parent 1df2a272cf
commit d16620a29f
6 files changed
+149 -7

No files matched your search

+7 -1
View File
@@ -124,7 +124,13 @@ class PlaybackClock {
subscribe(listener) {
if (this._destroyed || typeof listener !== 'function') return () => {};
this._sceneClockListeners.add(listener);
if (this._sceneClockSnapshot) listener({ ...this._sceneClockSnapshot });
if (this._sceneClockSnapshot) {
try {
listener({ ...this._sceneClockSnapshot });
} catch (error) {
console.warn('[Scenes] Scene clock listener failed:', error);
}
}
return () => this._sceneClockListeners.delete(listener);
}