Fix NullPointerException with log filtering