Skip to content

Commit

Permalink
Fixed NPE introduced in PR 8171 (openhab#8176)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
  • Loading branch information
cweitkamp authored and andrewfg committed Aug 31, 2020
1 parent 1032604 commit cf688df
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ public SenseBoxData reallyFetchDataFromServer(String senseBoxId) {

SenseBoxDescriptor descriptor = new SenseBoxDescriptor();
descriptor.setApiUrl(query);
if (!parsedData.getImage().isEmpty()) {
descriptor.setImageUrl(SENSEMAP_IMAGE_URL_BASE + "/" + parsedData.getImage());
String image = parsedData.getImage();
if (image != null && !image.isEmpty()) {
descriptor.setImageUrl(SENSEMAP_IMAGE_URL_BASE + "/" + image);
}
descriptor.setMapUrl(SENSEMAP_MAP_URL_BASE + "/explore/" + senseBoxId);
parsedData.setDescriptor(descriptor);
Expand Down

0 comments on commit cf688df

Please sign in to comment.