From 89000ff8fc1ce58f27855812fd3cac7eea87f0bf Mon Sep 17 00:00:00 2001 From: Patrick Plitzner Date: Wed, 9 Sep 2015 14:42:21 +0200 Subject: [PATCH] Fixed potnetial NPE --- .../java/eu/etaxonomy/taxeditor/store/SearchManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java index e5861f668..cc437488a 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java @@ -121,7 +121,10 @@ public class SearchManager { String titleSearchString = configurator.getTitleSearchString(); try { UUID uuid = UUID.fromString(titleSearchString); - records.add(CdmStore.getService(service).find(uuid)); + T foundRecord = CdmStore.getService(service).find(uuid); + if(foundRecord!=null){ + records.add(foundRecord); + } } catch (IllegalArgumentException e) { //search string was no UUID } -- 2.34.1