DATACMNS-1466 - Fixed potential ArrayIndexOutOfBoundsException in DefaultPersistentPropertyPath.

Introduced explicit content checks in ….getLeafProperty() and ….getBaseProperty().
This commit is contained in:
Oliver Drotbohm
2019-01-11 11:33:29 +01:00
parent 92848cd178
commit e0c08e64e8
2 changed files with 18 additions and 2 deletions

View File

@@ -144,7 +144,7 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
*/
@Nullable
public P getLeafProperty() {
return properties.get(properties.size() - 1);
return properties.isEmpty() ? null : properties.get(properties.size() - 1);
}
/*
@@ -153,7 +153,7 @@ class DefaultPersistentPropertyPath<P extends PersistentProperty<P>> implements
*/
@Nullable
public P getBaseProperty() {
return properties.get(0);
return properties.isEmpty() ? null : properties.get(0);
}
/*