Prevent ArgumentOutOfRangeException for emtpy files

What the title says :smile: