From c863cac8042de15a8ccd8bd6daaab3ca87ff48de Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 11 Jun 2019 16:20:35 +0000 Subject: [PATCH] cast: throw exception for invalid signals --- lib/hooks/cast.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/hooks/cast.cpp b/lib/hooks/cast.cpp index 7919ee4c3..2cd5c1589 100644 --- a/lib/hooks/cast.cpp +++ b/lib/hooks/cast.cpp @@ -81,6 +81,8 @@ public: enum signal_type type; orig_sig = (struct signal *) vlist_at_safe(&signals, signal_index); + if (!orig_sig) + throw RuntimeError("Failed to find signal: {}", signal_name); type = new_type != SIGNAL_TYPE_INVALID ? new_type : orig_sig->type; name = new_name ? new_name : orig_sig->name;