瀏覽代碼

ERM parser won't crash when there is no Data/s folder (addressing issue #717)

Michał W. Urbańczyk 14 年之前
父節點
當前提交
07ea131c97
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      lib/VCMI_Lib.cpp

+ 5 - 0
lib/VCMI_Lib.cpp

@@ -57,6 +57,11 @@ DLL_EXPORT void initDLL(CConsoleHandler *Console, std::ostream *Logfile)
 
 	using namespace boost::filesystem;
 	//parser checking
+	if(!exists("./Data/s/"))
+	{
+		tlog3 << "Warning: Folder ./Data/s/ doesn't exist!\n";
+		return;
+	}
 	directory_iterator enddir;
 	for (directory_iterator dir(DATA_DIR "/Data/s"); dir!=enddir; dir++)
 	{