Prevent null ptr deref detected by Coverity scan