about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-12-07 20:03:05 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-12-07 20:03:05 -0800
commit91dc725fa34e86111ceacc63c86bd75aa06e9c83 (patch)
tree0503c4f343a453be39e8895ae39229f3577c18fc /030container.cc
parentdca2ee53b1eb97a9d107dc4c997dcdd0a5b0b9df (diff)
downloadmu-91dc725fa34e86111ceacc63c86bd75aa06e9c83.tar.gz
2618
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/030container.cc b/030container.cc
index afe08952..1bae0da5 100644
--- a/030container.cc
+++ b/030container.cc
@@ -137,7 +137,7 @@ case GET: {
   }
   reagent base = inst.ingredients.at(0);  // new copy for every invocation
   // Update GET base in Check
-  if (!base.type || !base.type->value || get(Type, base.type->value).kind != CONTAINER) {
+  if (!base.type || !base.type->value || !contains_key(Type, base.type->value) || get(Type, base.type->value).kind != CONTAINER) {
     raise_error << maybe(get(Recipe, r).name) << "first ingredient of 'get' should be a container, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }
@@ -275,7 +275,7 @@ case GET_ADDRESS: {
   }
   reagent base = inst.ingredients.at(0);
   // Update GET_ADDRESS base in Check
-  if (!base.type || get(Type, base.type->value).kind != CONTAINER) {
+  if (!base.type || !base.type->value || !contains_key(Type, base.type->value) || get(Type, base.type->value).kind != CONTAINER) {
     raise_error << maybe(get(Recipe, r).name) << "first ingredient of 'get-address' should be a container, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }