Skip to content

Commit 4dff3a0

Browse files
authored
Check for NoneType on self.items[section]
Addresses this issue: #24
1 parent 578dc84 commit 4dff3a0

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)