File operations can return nulls if I/O errors occur, so we need to catch them at least.