From 2192354e68b27b2c287a49f8cef73afad5ca98a7 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Thu, 17 Aug 2023 18:41:43 -0700 Subject: SourceFilterRemoved: Support out-of-order InputRemoved --- src/obswebsocket.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/obswebsocket.cr') 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"] -- cgit v1.2.3