check summing a file that does not exist

I noticed that when I attempt to checksum a file that does not exist, an inappropriate error was being thrown. I added a test and a fix for it.

Basically, the stat result was being used before checking if there was an error from the stat call