diff --git a/CHANGELOG b/CHANGELOG index c03edc3..ebb9a0c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ - Default width set to 80 as many gopherhole and gemini capsule have it hardcoded - Streaming URL without valid content-length are now closed after 5Mo of download (thanks to Eoin Carney for reporting the issue) - Fixed a crash when the cache is already a dir inside a dir. +- Fixed a crash when manually entering an unknown gopher URL while offline ## 1.2 - March 24th 2022 Very experimental release: diff --git a/offpunk.py b/offpunk.py index 192f3b6..f783a8f 100755 --- a/offpunk.py +++ b/offpunk.py @@ -672,7 +672,7 @@ class GemtextRenderer(AbstractRenderer): def get_title(self): if self.title: return self.title - else: + elif self.body: lines = self.body.splitlines() for line in lines: if line.startswith("#"): @@ -689,6 +689,8 @@ class GemtextRenderer(AbstractRenderer): else: self.title = "Empty Page" return self.title + else: + return "Unknown Gopher Page" #render_gemtext def render(self,gemtext, width=None,mode=None): @@ -1471,8 +1473,8 @@ class GeminiItem(): f.close() return body else: - print("ERROR: NO CACHE for %s" %self._cache_path) - return error + #print("ERROR: NO CACHE for %s" %self._cache_path) + return None # This method is used to load once the list of links in a gi # Links can be followed, after a space, by a description/title