Ver código fonte

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

Ivan Arkhipov 7 anos atrás
pai
commit
0b361604ae
1 arquivos alterados com 4 adições e 0 exclusões
  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;
             }