Skip to content

Commit

Permalink
Fixed a crash in quick-aid widget when no save is loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
matzman666 committed Feb 4, 2016
1 parent ee73ccb commit 04d3666
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions widgets/quickaid/quickaidwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,34 @@ def StatsDataUpdated(self, caller, value, pathObjs):
def StimpakButtonClicked(self):
# Apparently need to do this because it raises a no items exception
if self.StatsData:
Stimpaks = self.StatsData.child("StimpakCount").value()
Stimpaks = self.StatsData.child("StimpakCount")

if Stimpaks > 0:
if Stimpaks and Stimpaks.value() > 0:
self.DataManager.rpcUseStimpak()

@QtCore.pyqtSlot()
def RadAwayButtonClicked(self):
# Apparently need to do this because it raises a no items exception
if self.StatsData:
Radaways = self.StatsData.child("RadawayCount").value()
Radaways = self.StatsData.child("RadawayCount")

if Radaways > 0:
if Radaways and Radaways.value() > 0:
self.DataManager.rpcUseRadAway()

@QtCore.pyqtSlot()
def UpdateUI(self):
if self.isVisible():
if self.StatsData:
Stimpaks = self.StatsData.child("StimpakCount").value()
Radaways = self.StatsData.child("RadawayCount").value()
Stimpaks = self.StatsData.child("StimpakCount")
if Stimpaks:
Stimpaks = Stimpaks.value()
else:
Stimpaks = 0
Radaways = self.StatsData.child("RadawayCount")
if Radaways:
Radaways = Radaways.value()
else:
Radaways = 0

if Stimpaks > 0:
self.Widgets.stimpakButton.setEnabled(True)
Expand Down

0 comments on commit 04d3666

Please sign in to comment.