summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cat/TPTScriptInterface.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cat/TPTScriptInterface.cpp b/src/cat/TPTScriptInterface.cpp
index e821559..6519aec 100644
--- a/src/cat/TPTScriptInterface.cpp
+++ b/src/cat/TPTScriptInterface.cpp
@@ -439,9 +439,13 @@ AnyType TPTScriptInterface::tptS_load(std::deque<std::string> * words)
//Arguments from stack
NumberType saveID = eval(words);
- c->OpenSavePreview(saveID.Value(), 0, false);
-
- return NumberType(0);
+ if (saveID.Value() > 0)
+ {
+ c->OpenSavePreview(saveID.Value(), 0, false);
+ return NumberType(0);
+ }
+ else
+ throw GeneralException("Invalid save ID");
}
AnyType TPTScriptInterface::tptS_bubble(std::deque<std::string> * words)