Skip to content

Commit

Permalink
script_editor.as: workaround: clamp error line num.s to actual line c…
Browse files Browse the repository at this point in the history
…ount
  • Loading branch information
ohlidalp committed Sep 26, 2023
1 parent 6112853 commit 5cc34b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/scripts/script_editor.as
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,11 @@ class ScriptEditorTab
int msgType = int(this.messages[i]['type']);
string msgText = string(this.messages[i]['message']);
int lineIdx = msgRow-1;
// workaround: clamp the msgRow to known line count
if (lineIdx >= bufferLinesMeta.length())
{
lineIdx = bufferLinesMeta.length() - 1;
}

// update line stats
if (msgType == asMSGTYPE_ERROR)
Expand Down

0 comments on commit 5cc34b4

Please sign in to comment.