check for null on core file

fix  #1761
core->file was a null, so this caused a crash