mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-222 clarified error message if trying to put the unitialized byteable key/value, that might be quite common mistake
This commit is contained in:
+8
-1
@@ -103,7 +103,14 @@ public class ByteableMarshaller<E extends Byteable>
|
||||
|
||||
@Override
|
||||
public void write(Bytes bytes, E e) {
|
||||
bytes.write(e.bytes(), e.offset(), size);
|
||||
Bytes eBytes = e.bytes();
|
||||
if (eBytes != null) {
|
||||
bytes.write(eBytes, e.offset(), size);
|
||||
} else {
|
||||
throw new NullPointerException("You are trying to write a byteable object of " +
|
||||
e.getClass() + ", " +
|
||||
"which bytes are not assigned. I. e. most likely the object is uninitialized.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user