From 37d7b326e2e2a3a37ad97b87963ca07a67f923e8 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Fri, 28 Oct 2011 15:20:14 +0000 Subject: [PATCH] Fixes a NPE in history reading. --- .../impl/callhistory/CallHistoryServiceImpl.java | 4 ++++ .../sip/communicator/impl/history/HistoryReaderImpl.java | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java index 45c3e64a3..c988a4b69 100644 --- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java @@ -476,6 +476,10 @@ else if (logger.isInfoEnabled()) private static List getCSVs(String str) { List result = new LinkedList(); + + if(str == null) + return result; + StringTokenizer toks = new StringTokenizer(str, DELIM); while(toks.hasMoreTokens()) { diff --git a/src/net/java/sip/communicator/impl/history/HistoryReaderImpl.java b/src/net/java/sip/communicator/impl/history/HistoryReaderImpl.java index 3080cf966..061d45588 100644 --- a/src/net/java/sip/communicator/impl/history/HistoryReaderImpl.java +++ b/src/net/java/sip/communicator/impl/history/HistoryReaderImpl.java @@ -217,9 +217,11 @@ public synchronized QueryResultSet findLast(int count) throws Run // Get nested TEXT node's value Node nodeValue = propertyNode.getFirstChild(); + if(nodeValue == null) + continue; + nameVals.add(propertyNode.getNodeName()); - nameVals.add(nodeValue == null ? - null : nodeValue.getNodeValue()); + nameVals.add(nodeValue.getNodeValue()); } }