Add a null check where necessary.
Merge pull request #230 from Clashnia/hqm

Add a null check where necessary.