Merge pull request #12575 from n8pjl/werror-nonnull IOFile: avoid clearing errors on null file struct