Skip to content

Commit f9eb214

Browse files
authored
Merge pull request #25 from aysiu/patch-1
Check for NoneType on self.items[section]
2 parents 578dc84 + 4dff3a0 commit f9eb214

File tree

1 file changed

+4
-3
lines changed
  • payload/Library/Python/2.7/site-packages

1 file changed

+4
-3
lines changed

payload/Library/Python/2.7/site-packages/docklib.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ def save(self):
114114
def findExistingLabel(self, test_label, section="persistent-apps"):
115115
"""Returns index of item with label matching test_label or -1 if not
116116
found."""
117-
for index in range(len(self.items[section])):
118-
if self.items[section][index]["tile-data"].get("file-label") == test_label:
119-
return index
117+
if self.items[section]:
118+
for index in range(len(self.items[section])):
119+
if self.items[section][index]["tile-data"].get("file-label") == test_label:
120+
return index
120121

121122
return -1
122123

0 commit comments

Comments
 (0)