Merge pull request #196 from bsinno/NPE_on_UI_when_clicking_target

NPE on ui when clicking target
This commit is contained in:
Michael Hirsch
2016-06-01 15:46:40 +02:00

View File

@@ -3,6 +3,8 @@
*/
package org.eclipse.hawkbit.ui.filter.target;
import java.net.URI;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.ui.filter.FilterExpression;
@@ -56,9 +58,10 @@ public class TargetSearchTextFilter implements FilterExpression {
}
private boolean ipAddressIgnoreCase() {
if (target.getTargetInfo().getAddress() == null) {
final URI targetAddress = target.getTargetInfo().getAddress();
if (targetAddress == null || targetAddress.getHost() == null) {
return false;
}
return target.getTargetInfo().getAddress().getHost().toUpperCase().contains(searchTextUpper);
return targetAddress.getHost().toUpperCase().contains(searchTextUpper);
}
}