summaryrefslogtreecommitdiff
path: root/grc/core
diff options
context:
space:
mode:
authorHåkon Vågsether <haakonsv@gmail.com>2018-11-16 16:46:06 +0100
committerMartin Braun <martin.braun@ettus.com>2018-11-22 13:48:33 -0800
commit896c2d1cbd45e8905fe90768466f1f922d65a520 (patch)
tree38a999f107770a0926c118443b0382bb77c835c3 /grc/core
parent99b8ef09b954c69492be95b68989d6d75b0446ee (diff)
grc: Validate vectors before validating their elements
Diffstat (limited to 'grc/core')
-rw-r--r--grc/core/params/dtypes.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/grc/core/params/dtypes.py b/grc/core/params/dtypes.py
index f52868c080..69f7d497dc 100644
--- a/grc/core/params/dtypes.py
+++ b/grc/core/params/dtypes.py
@@ -97,6 +97,9 @@ def validate_scalar(param):
def validate_vector(param):
# todo: check vector types
+ if param.get_evaluated() is None:
+ raise ValidateError('Expression {!r} is invalid for type{!r}.'.format(param.get_evaluated(), param.dtype))
+
valid_types = Constants.PARAM_TYPE_MAP[param.dtype.split('_', 1)[0]]
if not all(isinstance(item, valid_types) for item in param.get_evaluated()):
raise ValidateError('Expression {!r} is invalid for type {!r}.'.format(