Skip to content

Commit

Permalink
Fix crash for unknown types (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed Mar 7, 2020
1 parent ec4f89a commit e6fdef1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion judge/serialisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ def to_python_comparable(value: Optional[Value]):
return ComparableFloat(float(value.data))
if value.type == NumericTypes.INTEGER:
return int(value.data)
if value.type in (BooleanTypes.BOOLEAN, StringTypes.TEXT, NothingTypes.NOTHING):
if value.type in (BooleanTypes.BOOLEAN, StringTypes.TEXT, NothingTypes.NOTHING,
StringTypes.UNKNOWN):
return value.data

raise AssertionError(f"Unknown value type: {value}")
Expand Down

0 comments on commit e6fdef1

Please sign in to comment.