Skip to content

Commit

Permalink
only parse variable when value is not null
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Dec 7, 2022
1 parent 4b14ffa commit 9d19830
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export_settings.variables = ["first_variable", "Another_Variable"]

Set the names of layouts that should be considered (exported as template files) as a list:
```py
export_settings.variables = ["Layout One", "Layout Three"]
export_settings.layouts = ["Layout One", "Layout Three"]
```

### Generate the Files for a `ProjectTopping` containing `ExportSetting`
Expand Down
4 changes: 3 additions & 1 deletion toppingmaker/projecttopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,11 @@ def make_items(
):
self.clear()
for variable_key in export_settings.variables:
self[variable_key] = QgsExpressionContextUtils.projectScope(
variable_value = QgsExpressionContextUtils.projectScope(
project
).variable(variable_key)
if variable_value:
self[variable_key] = variable_value

class Layouts(dict):
"""
Expand Down

0 comments on commit 9d19830

Please sign in to comment.