Skip to content

On some com.apple.dock.plist files, there is no len() when looking at self.items[section] #24

@aysiu

Description

@aysiu

Results in this kind of error when trying to remove items:

Traceback (most recent call last):
  File "NAMEOFSCRIPT.py", line 14, in <module>
    dock.removeDockEntry(item_to_remove)
  File "/Library/Python/2.7/site-packages/docklib.py", line 130, in removeDockEntry
    found_index = self.findExistingLabel(label, section=sect)
  File "/Library/Python/2.7/site-packages/docklib.py", line 117, in findExistingLabel
    for index in range(len(self.items[section])):
TypeError: object of type 'NoneType' has no len()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions