From a5b6136e70abfbb7d083003c2d6e0137d859ad37 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Mon, 7 Jan 2013 21:58:02 +0100 Subject: [PATCH] Check word document validity before closing. --- doc/changelog.txt | 7 +++++++ linkcheck/checker/urlbase.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/doc/changelog.txt b/doc/changelog.txt index 3fb0d73a..cb160ae2 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,3 +1,10 @@ +8.4 "" (released xx.xx.2013) + +Fixes: +- checking: Fix a crash when closing a Word document after scanning failed. + Closes: GH bug #369 + + 8.3 "Mahna Mahna Killer" (released 6.1.2013) Features: diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py index 4390592a..8bd85657 100644 --- a/linkcheck/checker/urlbase.py +++ b/linkcheck/checker/urlbase.py @@ -1094,6 +1094,8 @@ class UrlBase (object): app = winutil.get_word_app() try: doc = winutil.open_wordfile(app, filename) + if doc is None: + raise winutil.Error("could not open word file %r" % filename) try: for link in doc.Hyperlinks: self.add_url(link.Address, name=link.TextToDisplay)