diff --git a/src/libprs500/__init__.py b/src/libprs500/__init__.py index e4127c75bd..f9f851dd3a 100644 --- a/src/libprs500/__init__.py +++ b/src/libprs500/__init__.py @@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to suit your distribution. """ -__version__ = "0.3.35" +__version__ = "0.3.36" __docformat__ = "epytext" __author__ = "Kovid Goyal " diff --git a/src/libprs500/ebooks/lrf/html/convert_from.py b/src/libprs500/ebooks/lrf/html/convert_from.py index 59d4b89de2..1fd8bded8f 100644 --- a/src/libprs500/ebooks/lrf/html/convert_from.py +++ b/src/libprs500/ebooks/lrf/html/convert_from.py @@ -450,11 +450,11 @@ class HTMLConverter(object): if not self.top.parent: if not previous: - try: - previous = self.book.pages()[0] - except IndexError: + self.top = get_valid_block(self.current_page) + if not self.top or not self.top.parent: raise ConversionError, self.file_name + ' does not seem to have any content' - + return + found = False for page in self.book.pages(): if page == previous: @@ -465,6 +465,7 @@ class HTMLConverter(object): if not self.top: continue break + if not self.top or not self.top.parent: raise ConversionError, 'Could not parse ' + self.file_name