Skip to content

Commit 964cf0a

Browse files
committed
Update utils.py
1 parent 90e57f6 commit 964cf0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

seatable_api/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ def convert_row(metadata, ws_data):
102102
def is_single_multiple_structure(column):
103103
column_type = column['type']
104104
if column_type in ('single-select', 'multiple-select'):
105-
options = column.get('data', {}).get('options', [])
105+
column_data = column.get('data', {})
106+
options = column_data and column_data.get('options', []) or []
106107
return True, options
107108
if column_type in ('link', 'link-formula'):
108109
array_type = column.get('data', {}).get('array_type')
109110
if array_type in ('single-select', 'multiple-select'):
110-
options = column.get('data', {}).get('array_data', {}).get('options', [])
111+
array_data = column.get('data', {}).get('array_data', {})
112+
options = array_data and array_data.get('options', []) or []
111113
return True, options
112114
return False, []
113115

0 commit comments

Comments
 (0)