Skip to content

Logging a 'null' string causes an exception. #256

@feisley

Description

@feisley

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

v4.6.14

New Bug Summary

We were logging code that could occasionally result in the string being passed to the logger being null. When this occurs the Logger itself emits an exception:

System.NullPointerException: Attempt to de-reference a null object

The stack trace is:

Class.LogEntryEventBuilder.applyDataMaskRules: line 752, column 1
Class.LogEntryEventBuilder.setMessage: line 171, column 1
Class.Logger.debug: line 1570, column 1

The code that we had to produce this was of the form:

String results = someFunctionThatCanReturnNull();
Logger.debug(results); // Error thrown here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Layer: Logger EngineItems related to the core logging engineLogging Source: ApexItems related to using Logger within ApexLogging Source: FlowItems related to using Nebula Logger within FlowLogging Source: Lightning ComponentsItems related to using Nebula Logger using JavaScript within lightning components (lwc & aura)Type: BugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions