Avoid IOException
Merge pull request #3211 from qifun/patch-2

Avoid IOException