aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/tt_concept.cpp4
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index a1bb1bcc32..990c8d204f 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -301,10 +301,14 @@ TTconcept *TTconcept::findBy20(int val) {
}
bool TTconcept::isWordId(int id) const {
+ if (this == nullptr)
+ return false;
return _wordP && _wordP->_id == id;
}
int TTconcept::getWordId() const {
+ if (this == nullptr)
+ return 0;
return _wordP ? _wordP->_id : 0;
}
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index e34b1b8ab0..99f2c78f3a 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -801,7 +801,7 @@ int TTparser::considerRequests(TTword *word) {
if (!_sentenceConcept->_concept0P) {
flag = filterConcepts(5, 0);
} else if (_sentenceConcept->_concept0P->compareTo("?") &&
- _sentenceConcept->_concept1P->isWordId(113) &&
+ (_sentenceConcept->_concept1P && _sentenceConcept->_concept1P->isWordId(113)) &&
word->_wordClass == WC_THING) {
TTconcept *oldConcept = _sentenceConcept->_concept0P;
_sentenceConcept->_concept0P = nullptr;