Fix NullPointerException when queue is not set