Skip to content

Commit

Permalink
Fix bug when no predefined_expressions are defined (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
asnyv authored Sep 23, 2021
1 parent 0815246 commit f52650c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions webviz_subsurface/plugins/_reservoir_simulation_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,14 @@ def __init__(
line_shape_fallback
)

# Retreive predefined expressions from configuration
self.predefined_expressions_path = None
if "predefined_expressions" in webviz_settings.shared_settings:
self.predefined_expressions_path = webviz_settings.shared_settings[
"predefined_expressions"
][predefined_expressions]
# Retreive predefined expressions from configuration and validate
self.predefined_expressions_path = (
None
if predefined_expressions is None
else webviz_settings.shared_settings["predefined_expressions"][
predefined_expressions
]
)
self.predefined_expressions = expressions_from_config(
get_path(self.predefined_expressions_path)
if self.predefined_expressions_path
Expand Down

0 comments on commit f52650c

Please sign in to comment.