From b48bc2d5a965dcde882297f240a04ab9445060cb Mon Sep 17 00:00:00 2001 From: Patrick Plitzner Date: Mon, 22 Jun 2015 08:50:16 +0200 Subject: [PATCH] - fixed potential NPE --- .../ui/element/UriWithLabelElement.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java index a4309ae9e..8e1ff1927 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -36,18 +36,21 @@ public class UriWithLabelElement extends TextWithLabelElement { super(formFactory, parentElement, labelString, null, textHeight, style); setUri(initialUri); } - + /** - * + * */ public void setUri(URI uri) { if(uri != null){ super.setText(uri.toString()); } } - + public URI getUri() throws URISyntaxException{ - return new URI(super.getText()); + if(super.getText()!=null){ + return new URI(super.getText()); + } + return null; } - + } -- 2.34.1