From 375d2470f5dbd81a1a3cb2b4dda361b35e3d5e2c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 1 Oct 2008 12:44:05 -0700 Subject: [PATCH] Fix #1110 (Unhandled error exception - saving to SD card) --- src/calibre/devices/prs505/books.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/devices/prs505/books.py b/src/calibre/devices/prs505/books.py index bcae4722ea..f42f1b5513 100644 --- a/src/calibre/devices/prs505/books.py +++ b/src/calibre/devices/prs505/books.py @@ -277,9 +277,12 @@ class BookList(_BookList): def purge_empty_playlists(self): ''' Remove all playlists that have no children. Also removes any invalid playlist items.''' for pli in self.playlist_items(): - if not self.is_id_valid(pli.getAttribute('id')): - pli.parentNode.removeChild(pli) - pli.unlink() + try: + if not self.is_id_valid(pli.getAttribute('id')): + pli.parentNode.removeChild(pli) + pli.unlink() + except: + continue for pl in self.playlists(): empty = True for c in pl.childNodes: