From b5674274e2bfdb1b0f67df7b723ca2829e717797 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 4 Dec 2014 16:44:22 +0100 Subject: [PATCH] + check if file handle is valid in FileInfo::isFile --- src/Base/FileInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base/FileInfo.cpp b/src/Base/FileInfo.cpp index 4a0cee5f5e..521bd8d8b9 100644 --- a/src/Base/FileInfo.cpp +++ b/src/Base/FileInfo.cpp @@ -325,7 +325,7 @@ bool FileInfo::isFile () const std::wstring wstr = toStdWString(); FILE* fd = _wfopen(wstr.c_str(), L"rb"); bool ok = (fd != 0); - fclose(fd); + if (fd) fclose(fd); return ok; } #else