From e73e5a7ebcbc97b651fca81dc4c928e8726ee01c Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sat, 30 Aug 2025 14:20:34 +1000 Subject: [PATCH] Fix a couple small things --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 97014b7..9b12bda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -656,7 +656,7 @@ Literal exec(vector in, bool executingFunction) { saves them to a list (vector) with name listName. */ case Instructions::Setlist: - if (l.args.size() < 2) { + if (l.args.size() < 1) { error("Could not find all arguments required for Setlist inbuilt"); } { @@ -726,10 +726,10 @@ Literal exec(vector in, bool executingFunction) { error("Index " + to_string(ref) + " out of range of list " + listref.listName); } } else { - error("Unknown list: " + listref.listName); + error("Found a normal variable in place of a list"); } } else { - error("Found a normal variable in place of a list"); + error("Unknown list: " + listref.listName); } } break; @@ -857,6 +857,9 @@ Literal exec(vector in, bool executingFunction) { } if (variables.find(listref.listName) != variables.end()) { + if (!holds_alternative(variables[listref.listName].val)) { + error("Variable " + listref.listName + "is not a list"); + } List tmpList = get(variables[listref.listName].val); tmpList.val.push_back(value); variables[listref.listName].val = tmpList;