Skip to content

Commit 5e4deed

Browse files
committed
[validation] Exit None Property.value value checks
The property value validations will break if a Property values list contains a 'None' value. As a failsafe exit these validations if a 'None' value is encountered.
1 parent d7acb4a commit 5e4deed

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

odml/validation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,10 @@ def property_values_check(prop):
514514
return
515515

516516
for val in prop.values:
517+
# Do not continue if a value is None
518+
if val is None:
519+
return
520+
517521
if dtype.endswith("-tuple"):
518522
tuple_len = int(dtype[:-6])
519523
if len(val) != tuple_len:
@@ -556,6 +560,10 @@ def property_values_string_check(prop):
556560
val_dtypes = []
557561

558562
for val in prop.values:
563+
# Do not continue if a value is None
564+
if val is None:
565+
return
566+
559567
curr_dtype = "string"
560568

561569
for check_dtype in dtype_checks.items():

0 commit comments

Comments
 (0)