Can you add an assertion here that the size of the queue is greater than 0? (assert on the value you receive.