Merge pull request #6024 from lhchavez/fix-possible-null-pointer-dereference Fix a possible null pointer dereference