summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@fairlystable.org>2023-08-17 18:41:43 -0700
committerJoe Rayhawk <jrayhawk@fairlystable.org>2023-08-17 18:44:51 -0700
commit2192354e68b27b2c287a49f8cef73afad5ca98a7 (patch)
tree3c449e2fc7d0130feb3ba6158dbba6024c4d7ff5 /src
parentf7b6daf551ff4bcd03980dfa593b6f8a8e3075d0 (diff)
downloadcrystal-obs-websocket-2192354e68b27b2c287a49f8cef73afad5ca98a7.tar.gz
crystal-obs-websocket-2192354e68b27b2c287a49f8cef73afad5ca98a7.zip
SourceFilterRemoved: Support out-of-order InputRemoved
Diffstat (limited to 'src')
-rw-r--r--src/obswebsocket.cr4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/obswebsocket.cr b/src/obswebsocket.cr
index d3432f4..33b4244 100644
--- a/src/obswebsocket.cr
+++ b/src/obswebsocket.cr
@@ -361,7 +361,9 @@ module OBS
# This could probably be made more efficient using the eventData
when "SourceFilterRemoved"
edata = d["eventData"]
- self.sources[edata["sourceName"].as_s].filters.deletecache()
+ if self.sources[edata["sourceName"].as_s]? # this event arrives *after* InputRemoved sometimes, so this source might not exist
+ self.sources[edata["sourceName"].as_s].filters.deletecache()
+ end
# This could probably be made more efficient using the eventData
when "SourceFilterNameChanged"
edata = d["eventData"]