Fix NPE when no source on file