Closed
Description
To deactivate the type mapping, the documentation advises to set typeKey
to null
As explained in the documentation
deactivating type mapping may lead to exceptions when reading the entities from the DB.
In the method com.arangodb.springframework.core.convert.DefaultArangoTypeMapper.DefaultTypeAliasAccessor#readAliasFrom
, the call source.get(this.typeKey);
throws a NullPointerException
when this.typeKey
is null. I suggest to add a non-null check before
before
if (source.isObject()) {
final VPackSlice typeKey = source.get(this.typeKey);
return Alias.ofNullable(typeKey.isString() ? typeKey.getAsString() : null);
}
after
if (source.isObject()) {
if (this.typeKey == null) return Alias.NONE;
final VPackSlice typeKey = source.get(this.typeKey);
return Alias.ofNullable(typeKey.isString() ? typeKey.getAsString() : null);
}
Here is the linked pull request