Merge pull request #1190 from DataDog/devinsba/hibernate-null-entity-check

Add null check to hibernate decorator
This commit is contained in:
Brian Devins-Suresh 2020-01-24 14:55:11 -05:00 committed by GitHub
commit 660041636a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ public class HibernateDecorator extends OrmClientDecorator {
@Override @Override
public String entityName(final Object entity) { public String entityName(final Object entity) {
if (entity == null) {
return null;
}
String name = null; String name = null;
final Set<String> annotations = new HashSet<>(); final Set<String> annotations = new HashSet<>();
for (final Annotation annotation : entity.getClass().getDeclaredAnnotations()) { for (final Annotation annotation : entity.getClass().getDeclaredAnnotations()) {