Skip to content

Commit 09ca74d

Browse files
committed
fix: handle null check for empty data in Message decoding logic
1 parent 13b8e2e commit 09ca74d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/src/main/java/io/ably/lib/types/BaseMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ public void decode(ChannelOptions opts, DecodingContext context) throws Message
171171
}
172172

173173
//last message bookkeping
174-
if(lastPayload instanceof String)
174+
if (lastPayload instanceof String)
175175
context.setLastMessageData((String)lastPayload);
176176
else if (lastPayload instanceof byte[])
177177
context.setLastMessageData((byte[])lastPayload);
178-
else
178+
else if (lastPayload != null)
179179
throw MessageDecodeException.fromDescription("Message data neither String nor byte[]. Unsupported message data type.");
180180
}
181181

0 commit comments

Comments
 (0)