Skip to content

Commit d9b5b36

Browse files
committed
Null check on the payload of KeyValue
The code expect that the payload is never null but there are now a lot of public constructor functions for KeyValue that don't check for this property.
1 parent 5b5d8c6 commit d9b5b36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

srcs/juloo.keyboard2/KeyValue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ public String toString()
291291

292292
private KeyValue(Object p, int kind, int value, int flags)
293293
{
294+
if (p == null)
295+
throw new NullPointerException("KeyValue payload cannot be null");
294296
_payload = p;
295297
_code = (kind & KIND_BITS) | (flags & FLAGS_BITS) | (value & VALUE_BITS);
296298
}

0 commit comments

Comments
 (0)