Fix possible null-dereference (thanks Coverity)