Skip to content

Commit

Permalink
Encoders: do not save encoder config if it becomes None.
Browse files Browse the repository at this point in the history
Subtle bug: one cannot save encoder config if it becomes None. Therefore guard against encoder config becoming None and raise a RuntimeError.
This will be backported to LTS20.
  • Loading branch information
josephsl committed Jan 27, 2021
1 parent 07aff71 commit df6a348
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addon/appModules/splengine/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def _removeEncoderID(encoderType: str, pos: str) -> None:

# Save encoder labels and flags, called when closing app modules and/or config save command is pressed.
def saveEncoderConfig() -> None:
# 21.03/20.09.6-LTS: is encoder config even alive?
if encoderConfig is None:
raise RuntimeError("Encoder config is not defined, cannot save encoder settings")
# Gather stream labels and flags.
# 20.11: dictionaries and sets are global items.
encoderConfig["EncoderLabels"] = dict(SPLEncoderLabels)
Expand Down

0 comments on commit df6a348

Please sign in to comment.