From bef689d0a2e07c54e6f8bd39ac88e5113a8528a4 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 23 Dec 2014 00:30:34 +0100 Subject: [PATCH] NPE fix --- htroot/ConfigPortal.java | 2 +- htroot/ViewLog_p.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java index cedcdbf9b..58eb3d633 100644 --- a/htroot/ConfigPortal.java +++ b/htroot/ConfigPortal.java @@ -219,7 +219,7 @@ public class ConfigPortal { prop.put("target_selected_special_searchresult", "searchresult".equals(target_special) ? 1 : 0); prop.put("target_special_pattern", sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, "")); - String myaddress = (sb.peers == null) ? null : sb.peers.mySeed() == null ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP()); + String myaddress = (sb.peers == null) || sb.peers.mySeed() == null || sb.peers.mySeed().getIP() == null ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP()); if (myaddress == null) { myaddress = "localhost:" + sb.getLocalPort("port", 8090); } diff --git a/htroot/ViewLog_p.java b/htroot/ViewLog_p.java index 6e3ef1bea..a5783226e 100644 --- a/htroot/ViewLog_p.java +++ b/htroot/ViewLog_p.java @@ -102,6 +102,7 @@ public class ViewLog_p { int level = 0; int lc = 0; for (final String logLine : log) { + if (logLine == null) break; final String nextLogLine = logLine.trim(); if (filterMatcher != null) {