Fix for Coverity Issue 1166829: Dereference before null check