Skip to content

Commit 90d8089

Browse files
committed
Always initialize source_model in _populate_source_model
When the OBS connection is unavailable, `_populate_source_model` returns early without setting `self.source_model`. This causes an `AttributeError` when `load_config_defaults` subsequently calls `self.source_model.get_n_items()`, breaking the configuration UI. This patch moves the `Gio.ListStore()` initialization to the top of `_populate_source_model`, before the connection check and early return. After this change, `load_config_defaults` sees an empty model (zero items) and safely falls through to the `else` branch without error.
1 parent d1081e7 commit 90d8089

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

actions/TimerSourceActionCore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ def on_change_source(self, sources, *args):
8888
self.set_settings(settings)
8989

9090
def _populate_source_model(self):
91+
self.source_model = Gio.ListStore()
92+
9193
if not self.plugin_base.get_connected():
9294
self.reconnect_obs()
9395
if not self.plugin_base.get_connected():
9496
return
95-
96-
self.source_model = Gio.ListStore()
9797
sources = sorted(
9898
self.plugin_base.backend.get_all_livesplit_one_sources(),
9999
key=lambda source: source["name"]

0 commit comments

Comments
 (0)