aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2019-02-19 10:21:44 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2019-02-19 10:21:44 +0100
commit33e3851a1a625e643ece64cacc8247640bd0c470 (patch)
treea28ea122531a49a60c3b26c33d819ee2502edf69 /moaSig/moa-sig-lib/src/main/java
parent0a694ef6ca0831053c8c89ba593e462770f76b7e (diff)
downloadmoa-sig-33e3851a1a625e643ece64cacc8247640bd0c470.tar.gz
moa-sig-33e3851a1a625e643ece64cacc8247640bd0c470.tar.bz2
moa-sig-33e3851a1a625e643ece64cacc8247640bd0c470.zip
fix possible NullPointerException
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java
index cca9117..74491d8 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java
@@ -24,6 +24,7 @@
package at.gv.egovernment.moa.spss.server.logging;
+import at.gv.egovernment.moaspss.logging.LoggingContext;
import at.gv.egovernment.moaspss.logging.LoggingContextManager;
import iaik.logging.Log;
import iaik.logging.LogConfigurationException;
@@ -52,10 +53,12 @@ public class IaikLogFactory extends LogFactory {
* @return The <code>iaik.logging.Log</code> object to log messages to.
*/
private Log getInstanceImpl() {
- String nodeID =
- LoggingContextManager.getInstance().getLoggingContext().getNodeID();
-
- return new IaikLog(nodeID);
+ LoggingContext context = LoggingContextManager.getInstance().getLoggingContext();
+ if (context != null)
+ return new IaikLog(context.getNodeID());
+ else
+ return new IaikLog("Internal");
+
}
public void release() {