Return to repo list

opet

Oblivion Proton .esp Tool
Return to HMagellan.com

commit 1ae776f9c951c5e8cc284ef406a71b05b1841022
parent 447230411c879dc9b1ce5512e5c04367e8236eff
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Thu,  7 Jan 2021 17:54:04 -0600

focus index check bypasses segfault

Diffstat:
Msrc/opet.py | 1-
Msrc/wxcustom.py | 3++-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/opet.py b/src/opet.py @@ -104,7 +104,6 @@ class OPETFrame(wx.Frame): entry = ["", index, e, self.espjson["comments"][e] if e in self.espjson["comments"] else ""] self.esp_list_ctrl.Append(entry) index += 1 - self.esp_list_ctrl.Select(0) def on_new_profile(self, event): pass diff --git a/src/wxcustom.py b/src/wxcustom.py @@ -42,6 +42,7 @@ class ESPListCtrl(wx.ListCtrl, listctrl.TextEditMixin): if event.GetColumn() == 0: event.Veto() fi = self.GetFocusedItem() - self.CheckItem(fi, not self.IsItemChecked(fi)) + if fi != -1: + self.CheckItem(fi, not self.IsItemChecked(fi)) else: event.Skip()