squirrel icon indicating copy to clipboard operation
squirrel copied to clipboard

Logging an error causes a NullPointerException

Open jorgelamb opened this issue 9 years ago • 1 comments

Hi,

We are having some issue in our project using squirrel framework. For some unknown reason we are still trying to find and after working fine for several hours the mvel condition fails, but then in the catch block it tries to log the exceptions .getCause().getMessage() and that causes a NullPointerException.

Some exceptions might have the getCause() as null, so it would be safer to check for null before logging it.

The affected line:

logger.error("Evaluate \""+mvelExpression+"\" failed, which caused by "+e.getCause().getMessage());

Thanks

jorgelamb avatar Jan 16 '17 08:01 jorgelamb

accepted, thx!

hekailiang avatar Jan 16 '17 11:01 hekailiang