Skip to content

Commit 2b981ec

Browse files
committed
Fixed property unquoting so that empty strings are allowed and do not cause a crash.
Signed-off-by: Maciej Kurc <[email protected]>
1 parent 0f01921 commit 2b981ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fpga_interchange/interchange_capnp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ def create_property_map(self, property_map, d):
243243
entry.key = self.string_id(k)
244244

245245
if isinstance(v, str):
246-
if v[0] == '"' and v[-1] == '"':
247-
v = v[1:-1]
246+
if len(v) >= 2:
247+
if v[0] == '"' and v[-1] == '"':
248+
v = v[1:-1]
248249
entry.textValue = self.string_id(v)
249250
elif isinstance(v, bool):
250251
entry.boolValue = v

0 commit comments

Comments
 (0)