diff --git a/Source/Core/Common/IOFile.h b/Source/Core/Common/IOFile.h index 4b12c31888..b5895333b1 100644 --- a/Source/Core/Common/IOFile.h +++ b/Source/Core/Common/IOFile.h @@ -116,7 +116,8 @@ public: void ClearError() { m_good = true; - std::clearerr(m_file); + if (IsOpen()) + std::clearerr(m_file); } private: