Skip to content

Commit e886b96

Browse files
authored
check null for dataHandler (#24)
1 parent cf7ab36 commit e886b96

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

unity/EzyWSClient.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,18 @@ String jsonData
115115
);
116116
var ezyData = EzyJsons.deserialize(jsonData);
117117
var command = (EzyCommand)commandId;
118-
EzyClients.getInstance()
118+
var dataHandler = EzyClients.getInstance()
119119
.getClient(clientName)
120120
.getHandlerManager()
121-
.getDataHandler(command)
122-
.handle((EzyArray)ezyData);
121+
.getDataHandler(command);
122+
if (dataHandler == null)
123+
{
124+
LOGGER.warn("has no handler for command: " + command);
125+
}
126+
else
127+
{
128+
dataHandler.handle((EzyArray)ezyData);
129+
}
123130
}
124131

125132
public EzySetup setup()

0 commit comments

Comments
 (0)