diff options
author | Victor Häggqvist <[email protected]> | 2014-11-18 11:43:09 +0100 |
---|---|---|
committer | Victor Häggqvist <[email protected]> | 2014-11-18 11:43:09 +0100 |
commit | ac79fb2dacd0e6af14006bf25773b52b055d6676 (patch) | |
tree | b18bd0cbd2b49c3b4be847d3753a478c021fe221 | |
parent | 1b5357bcb678556b33e12b28ebc55f616b33fc0f (diff) |
fix index out of range
-rwxr-xr-x[-rw-r--r--] | AndroidResR/AndroidResR.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/AndroidResR/AndroidResR.py b/AndroidResR/AndroidResR.py index f652d35..6fd31f3 100644..100755 --- a/AndroidResR/AndroidResR.py +++ b/AndroidResR/AndroidResR.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 import os from os import listdir, remove @@ -127,8 +128,9 @@ class Window(QtGui.QMainWindow, Ui_MainWindow): # On selection change in src list def srcSelectionChange(self): - self.currentIndex = self.srcListWidget.selectedIndexes()[0].row() - self.previewIcon() + if len(self.srcListWidget.selectedIndexes())>0: + self.currentIndex = self.srcListWidget.selectedIndexes()[0].row() + self.previewIcon() # On color checkbox clicked def colorClick(self): |