diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 20d587df..455011ab 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -468,7 +468,11 @@ void editorclass::removehookfromscript(std::string t) { //If this line is not the start of a new hook, remove it! tstring=script.customscript[i]; - tstring=tstring[tstring.length()-1]; + if (tstring.length() > 0) { + tstring=tstring[tstring.length()-1]; + } else { + tstring=""; + } if(tstring==":") { //this is a hook