Add check for null file