Skip to content

Commit

Permalink
fix bug when not finding a key while sending feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamgie committed Dec 21, 2022
1 parent ae4c6de commit 6a85939
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Runtime/OSCQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ bool checkFilteredComp(String typeString)

void ProcessIncomingMessages()
{
while (receiver.hasWaitingMessages())
while (receiver != null && receiver.hasWaitingMessages())
{
OSCMessage msg = receiver.getNextMessage();

Expand Down Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit 6a85939

Please sign in to comment.