File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
server/src/com/mirth/connect/plugins/serverlog Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,12 @@ public void append(LogEvent logEvent) {
3838
3939 String channelId = null ;
4040 String channelName = null ;
41+
42+ // Check theoretically not necessary, as getContextMap never returns null
43+ // Safety first
4144 if (logEvent .getContextMap () != null ) {
42- if (logEvent .getContextMap ().containsKey ("channelId" )) {
43- channelId = logEvent .getContextMap ().get ("channelId" );
44- }
45- if (logEvent .getContextMap ().containsKey ("channelName" )) {
46- channelName = logEvent .getContextMap ().get ("channelName" );
47- }
45+ channelId = logEvent .getContextMap ().getOrDefault ("channelId" , "" );
46+ channelName = logEvent .getContextMap ().getOrDefault ("channelName" , "" );
4847 }
4948
5049 String level = String .valueOf (logEvent .getLevel ());
You can’t perform that action at this time.
0 commit comments