浏览代码

Checking if DatFile is in incorrect state in DatFile::SetLocale()

Ivan Arkhipov 7 年之前
父节点
当前提交
0b361604ae
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/DatFile.cpp

+ 4 - 0
src/DatFile.cpp

@@ -667,6 +667,10 @@ namespace LOTRO_DAT {
 
     void DatFile::SetLocale(LOCALE locale) {
         try {
+            if (dat_state_ < READY) {
+                fprintf(stderr, "Bad DatFile::SetLocale() - DatFile is in incorrect state... Cannot set locale\n");
+                return;
+            }
             if (current_locale_ == locale) {
                 return;
             }