aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-11-22 18:25:16 +0000
committerTorbjörn Andersson2006-11-22 18:25:16 +0000
commit5c9d5199f8139aa85203343efad54be4e80a6132 (patch)
tree788d7e0cdf4ddcf1ea3a835c88423539fc4126e3 /engines
parentcfb29dcb5199922e40e08b7cdc6502478782006c (diff)
downloadscummvm-rg350-5c9d5199f8139aa85203343efad54be4e80a6132.tar.gz
scummvm-rg350-5c9d5199f8139aa85203343efad54be4e80a6132.tar.bz2
scummvm-rg350-5c9d5199f8139aa85203343efad54be4e80a6132.zip
Don't crash in loadDict() if pred.txt is missing.
svn-id: r24761
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/predictive.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 2de626d1f4..6fed021fb3 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -63,8 +63,11 @@ bool TextMan::predictiveDialog(void) {
};
const char *modes[] = { "Pre", "123", "Abc" };
- if (!_dict.size())
+ if (!_dict.size()) {
loadDict();
+ if (!_dict.size())
+ return false;
+ }
draw_window(50, 40, 269, 159);
draw_rectangle(62, 54, 249, 66, MSG_BOX_TEXT);
@@ -267,7 +270,8 @@ void TextMan::loadDict(void) {
Common::File in;
char buf[MAXLINELEN];
- in.open("pred.txt");
+ if (!in.open("pred.txt"))
+ return;
while (!in.eos()) {
if (!in.readLine(buf, MAXLINELEN))