mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-20 17:57:52 +02:00
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.
This commit is contained in:
parent
5b5d8c692e
commit
d9b5b36c27
@ -291,6 +291,8 @@ public final class KeyValue implements Comparable<KeyValue>
|
|||||||
|
|
||||||
private KeyValue(Object p, int kind, int value, int flags)
|
private KeyValue(Object p, int kind, int value, int flags)
|
||||||
{
|
{
|
||||||
|
if (p == null)
|
||||||
|
throw new NullPointerException("KeyValue payload cannot be null");
|
||||||
_payload = p;
|
_payload = p;
|
||||||
_code = (kind & KIND_BITS) | (flags & FLAGS_BITS) | (value & VALUE_BITS);
|
_code = (kind & KIND_BITS) | (flags & FLAGS_BITS) | (value & VALUE_BITS);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user