summaryrefslogtreecommitdiff
path: root/src/client/Client.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-19 17:57:29 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-19 17:57:29 (GMT)
commitb1df1e164c7356e419957c88b4690f3d10c5ec7a (patch)
tree115888355db9f1ba0bc004ff7a2fc39abd69dff5 /src/client/Client.cpp
parent186e62dec45bc1e606b3a536f4f6689922910b9b (diff)
downloadpowder-b1df1e164c7356e419957c88b4690f3d10c5ec7a.zip
powder-b1df1e164c7356e419957c88b4690f3d10c5ec7a.tar.gz
Catch exceptions when loading initial stamp
Diffstat (limited to 'src/client/Client.cpp')
-rw-r--r--src/client/Client.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index 0f6273c..ad5e458 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -818,8 +818,16 @@ SaveFile * Client::GetStamp(std::string stampID)
stampFile.close();
SaveFile * file = new SaveFile(std::string(stampID).c_str());
- GameSave * tempSave = new GameSave((char *)tempData, fileSize);
- file->SetGameSave(tempSave);
+ GameSave * tempSave = NULL;
+ try
+ {
+ GameSave * tempSave = new GameSave((char *)tempData, fileSize);
+ file->SetGameSave(tempSave);
+ }
+ catch (ParseException & e)
+ {
+ std::cerr << "Client: Invalid stamp file, " << stampID << " " << std::string(e.what()) << std::endl;
+ }
return file;
}
else