You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when authentication is not set, one will get npe out of
sdElement.addSDParam("subject", subject);
03.05.2024 14:06:09.529 [ERROR] [com.teragrep.lsh_01.RelpConversion] [http-input-handler-executor[T#1]] Unexpected error when sending a message: <Cannot invoke "String.length()" because "paramValue" is null> java.lang.NullPointerException: Cannot invoke "String.length()" because "paramValue" is null
at com.teragrep.rlo_14.SyslogMessage.getEscapedParamValue(SyslogMessage.java:273)
at com.teragrep.rlo_14.SyslogMessage.writeSDElements(SyslogMessage.java:265)
at com.teragrep.rlo_14.SyslogMessage.toRfc5424SyslogMessage(SyslogMessage.java:248)
at com.teragrep.rlo_14.SyslogMessage.toRfc5424SyslogMessage(SyslogMessage.java:207)
at com.teragrep.lsh_01.RelpConversion.sendMessage(RelpConversion.java:191)
at com.teragrep.lsh_01.RelpConversion.onNewMessage(RelpConversion.java:81)
at com.teragrep.lsh_01.MessageProcessor.processMessage(MessageProcessor.java:139)
at com.teragrep.lsh_01.MessageProcessor.run(MessageProcessor.java:121)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
sdElement.addSDParam("subject", subject); can't cause an NPE.
The Subject is created in MessageProcessor, either as an empty string (SubjectAnonymous) or an actual string (SubjectImpl). SubjectImpl is only created through BasicAuthentication for now, and there, the asSubject() method checks for null values and throws an IllegalArgumentException if that is the case.
Describe the bug
when authentication is not set, one will get npe out of
sdElement.addSDParam("subject", subject);
same goes for
Expected behavior
no npe, empty element.
How to reproduce
send message without authentication set
Screenshots
Software version
3.1.1
Desktop (please complete the following information if relevant):
Additional context
The text was updated successfully, but these errors were encountered: