Do an additional range check before grabbing a dialogue line by index in BaseGrid. Not doing it makes MSVC debug runtimes spew assertions and whatnot. This shouldn't break anything... I hope it doesn't.
Originally committed to SVN as r4134.
This commit is contained in:
parent
5cafad1d81
commit
6a431b9032
1 changed files with 1 additions and 0 deletions
|
@ -972,6 +972,7 @@ void BaseGrid::SetColumnWidths() {
|
|||
AssDialogue *BaseGrid::GetDialogue(int n) {
|
||||
try {
|
||||
if (n < 0) return NULL;
|
||||
if ((size_t)n >= diagMap.size()) return NULL;
|
||||
AssEntry *e = *diagMap.at(n);
|
||||
if (e->GetType() != ENTRY_DIALOGUE) return NULL;
|
||||
return AssEntry::GetAsDialogue(e);
|
||||
|
|
Loading…
Reference in a new issue