diff --git a/Runtime/OSCQuery.cs b/Runtime/OSCQuery.cs index 98a5078..cb5249e 100644 --- a/Runtime/OSCQuery.cs +++ b/Runtime/OSCQuery.cs @@ -641,7 +641,7 @@ bool checkFilteredComp(String typeString) void ProcessIncomingMessages() { - while (receiver.hasWaitingMessages()) + while (receiver != null && receiver.hasWaitingMessages()) { OSCMessage msg = receiver.getNextMessage(); @@ -782,6 +782,12 @@ void ProcessIncomingMessages() void sendFeedback(string address, WSQuery query) { + if (!compInfoMap.ContainsKey(address)) + { + Debug.Log("Address " + address + " is not registered, skipping feedback"); + return; + } + CompInfo info = compInfoMap[address]; object oldData = null; @@ -797,7 +803,8 @@ void sendFeedback(string address, WSQuery query) if (data == null) return; - propQueryPreviousValues[address] = data; + if (!propQueryPreviousValues.ContainsKey(address)) propQueryPreviousValues.Add(address, data); + else propQueryPreviousValues[address] = data; OSCMessage m = new OSCMessage(address);