Fix infinite recursion when a file is invalid (corrupted, empty, or mid-write)
Merge pull request #9156 from jacksontj/develop

Fix infinite recursion when a file is invalid (corrupted, empty, or mid-write)