Fix null-pointer exception in multi classloader enviromnment

- When we cannot find the class of the stack trace (for example in SBT the classes are loaded in different loaders), it will have null as class. Check for that null