What is the best way to handle a NullPointerException coming from a Throwable catch.
public void run() {
try{
}catch (Throwable e){
// e.getMessage() is equal to null
// and sends a NullPointerException
if (e.getMessage().equals(“something“){
}
}
}
Making some research I found here that the JIT compiler will optimize away stack traces in certain exceptions if they happen enough
I thought I can throw an Exception inside the Throwable catch, but it doesn’t look clean.
Thanks!