NPE in ORecordSerializerBinaryV0
See original GitHub issueThere is the following code in ORecordSerializerBinaryV0
private int writeEmbeddedMap(BytesContainer bytes, Map<Object, Object> map) {
final int[] pos = new int[map.size()];
int i = 0;
Entry<Object, Object> values[] = new Entry[map.size()];
final int fullPos = OVarIntSerializer.write(bytes, map.size());
for (Entry<Object, Object> entry : map.entrySet()) {
// TODO:check skip of complex types
// FIXME: changed to support only string key on map
OType type = OType.STRING;
writeOType(bytes, bytes.alloc(1), type);
writeString(bytes, entry.getKey().toString());
pos[i] = bytes.alloc(OIntegerSerializer.INT_SIZE + 1);
values[i] = entry;
i++;
}
The problem is that some Maps can contains nulls as keys. So there will be NPE here: entry.getKey().toString()
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
NPE while retrieving field from document · Issue #3795 ... - GitHub
Randomly ODB throws NPE while retrieving field from document. ... ORecordSerializerBinaryV0.deserialize(ORecordSerializerBinaryV0.java:175)
Read more >Syncleus/Ferma - Gitter
@freemo Looks like a bug in orientdb to me. The code just wants to access the label (type) of the vertex but an...
Read more >orientdb - Multithreaded deletion and re-insertion fails with Orient ...
It looks like a record is misread and leads to a NullPointerException during a DELETE VERTEX ... stringFromBytes(ORecordSerializerBinaryV0.java:992) at ...
Read more >OrientDB - [orientdb] remove a bad record?
I'm getting an error when retrieving a record. When I try to delete the vertex, I get the same - null pointer exception....
Read more >Adventures with Nexus in Kubernetes: database corruption ...
java.lang.NullPointerException at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yea - you can define as you wish: but during deserialization, I guess it should be transformed back to null. Right? If it’s not possible: I think that OrientDB should transform null into “” (empty string) key.
hi @PhantomYdn,
double checking the fix i did the exception go up in any case of set of a null value on a tracked map, this for me is more than enough.
Closing