diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-14 23:59:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-14 23:59:44 +0300 |
commit | bf235a610f10301471ca83ce153511d63b3fa9f9 (patch) | |
tree | 807def519ff2dd564cdb23a4c05cd9a79338eab2 /src/gui/shopwindow.cpp | |
parent | bf9bccc30a186e338f96c230a4f63cc924c77bd8 (diff) | |
download | mv-bf235a610f10301471ca83ce153511d63b3fa9f9.tar.gz mv-bf235a610f10301471ca83ce153511d63b3fa9f9.tar.bz2 mv-bf235a610f10301471ca83ce153511d63b3fa9f9.tar.xz mv-bf235a610f10301471ca83ce153511d63b3fa9f9.zip |
Add missing checks.
Diffstat (limited to 'src/gui/shopwindow.cpp')
-rw-r--r-- | src/gui/shopwindow.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index 7578cbf7b..fdfea5d15 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -312,6 +312,11 @@ void ShopWindow::loadList() if (!stat(shopListName.c_str(), &statbuf) && S_ISREG(statbuf.st_mode)) { shopFile.open(shopListName.c_str(), std::ios::in); + if (!shopFile.is_open()) + { + shopFile.close(); + return; + } char line[101]; while (shopFile.getline(line, 100)) { |