Check for null
Fix for issue https://github.com/rmuller/infomas-asl/issues/17
Port refactoring