Logging for the nullptr exception, not the best fix tho