mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-16 06:18:34 +02:00
ArrayOfLtree: fix handling of "null" string value
If a topic tag is set to "null", the data in the column will have double quotes around it (to distinguish it from an actual null value). This wasn't being handled and would cause a crash when trying to parse the value.
This commit is contained in:
@@ -118,6 +118,11 @@ class ArrayOfLtree(ARRAY):
|
||||
if not value:
|
||||
return []
|
||||
|
||||
# the only case where there might be an escaped item (surrounded by double
|
||||
# quotes) is the string "null" - all other causes of escaping aren't valid
|
||||
# for ltree values
|
||||
value = value.replace('"null"', "null")
|
||||
|
||||
return value.split(",")
|
||||
|
||||
def process(value: Optional[str]) -> Optional[list[str]]:
|
||||
|
||||
Reference in New Issue
Block a user