about summary refs log tree commit diff stats
path: root/060recipe.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-06-12 09:44:27 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-06-12 09:44:27 -0700
commit4e7186faee27a32b92035b843ad24b5c61a3dc44 (patch)
tree86a55246b5b9347f8fcae1af3656f415a9579580 /060recipe.cc
parent6dd675764158bca3ab9547f6c653bdf8ba277d43 (diff)
downloadmu-4e7186faee27a32b92035b843ad24b5c61a3dc44.tar.gz
3052 - make edit/ render functions higher-order
This required the fix of 3051 to first-class recipe support, and will
next enable us to keep the cursor from moving in response to resize
events.
Diffstat (limited to '060recipe.cc')
-rw-r--r--060recipe.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/060recipe.cc b/060recipe.cc
index d60badb6..b7d1e71f 100644
--- a/060recipe.cc
+++ b/060recipe.cc
@@ -64,6 +64,10 @@ case CALL: {
     trace("trace") << "indirect 'call': incrementing callstack depth to " << Trace_stream->callstack_depth << end();
     assert(Trace_stream->callstack_depth < 9000);  // 9998-101 plus cushion
   }
+  if (!ingredients.at(0).at(0)) {
+    raise << maybe(current_recipe_name()) << "tried to call empty recipe in '" << to_string(current_instruction()) << "'" << end();
+    break;
+  }
   const instruction& caller_instruction = current_instruction();
   Current_routine->calls.push_front(call(ingredients.at(0).at(0)));
   ingredients.erase(ingredients.begin());  // drop the callee