Avoid a crash when cached queue is invalid

Signed-off-by: Miguel M. Almeida <miguelcma@gmail.com>