better handle empty queue
fix pylint space error
Merge pull request #12136 from UtahDave/develop

better handle empty queue