FileScanner: fix Coverity ID 1026724 Dereference before null check

Move some code to after the NULL check.