summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp
index c4cc30e602..7b2a890a8e 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1112,10 +1112,20 @@ bool Main::start() {
test = args[i + 1];
} else if (args[i] == "--export") {
editor = true; //needs editor
- _export_preset = args[i + 1];
+ if (i + 1 < args.size()) {
+ _export_preset = args[i + 1];
+ } else {
+ ERR_PRINT("Export preset name not specified");
+ return false;
+ }
} else if (args[i] == "--export-debug") {
editor = true; //needs editor
- _export_preset = args[i + 1];
+ if (i + 1 < args.size()) {
+ _export_preset = args[i + 1];
+ } else {
+ ERR_PRINT("Export preset name not specified");
+ return false;
+ }
export_debug = true;
} else {
// The parameter does not match anything known, don't skip the next argument