Skip to content

Commit 55c787a

Browse files
committed
Do not assume the import_group exists.
When attempting to update import declarations in the -edit file, do not assume that `project.import_group` exists -- it may only exist if the ODK configuration actually contains an import section. closes #1278
1 parent 853e7db commit 55c787a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

odk/odk.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,11 +1175,12 @@ def update_import_declarations(project, pluginsdir='/tools/robot-plugins'):
11751175
os.environ['ROBOT_JAVA_ARGS'] = ignore_missing_imports
11761176

11771177
cmd = f'robot odk:import -i {project.id}-edit.{project.edit_format} --exclusive true'
1178-
if project.import_group.use_base_merging:
1179-
cmd += f' --add {base}/imports/merged_import.owl'
1180-
else:
1181-
for product in project.import_group.products:
1182-
cmd += f' --add {base}/imports/{product.id}_import.owl'
1178+
if project.import_group is not None:
1179+
if project.import_group.use_base_merging:
1180+
cmd += f' --add {base}/imports/merged_import.owl'
1181+
else:
1182+
for product in project.import_group.products:
1183+
cmd += f' --add {base}/imports/{product.id}_import.owl'
11831184
if project.components is not None:
11841185
for component in project.components.products:
11851186
cmd += f' --add {base}/components/{component.filename}'

0 commit comments

Comments
 (0)