forked from solderpunk/AV-98
fix view link crashing with empty files
This commit is contained in:
parent
36c9709bc4
commit
9bec3b48dd
|
@ -16,6 +16,7 @@
|
|||
- offpunk: support for "preformatted" theming (bug #38)
|
||||
- opnk/netcache: added "--cache-validity" command-line argument (bug #37)
|
||||
- ansicat: consider files as XML, not SVG, if they don’t have .svg extension
|
||||
- offpunk: fix "view link" crashing with link to empty files
|
||||
|
||||
## 2.1 - December 15th 2023
|
||||
- freshly updated gemtext/rss links are highlighted ("new_link" theme option)
|
||||
|
|
|
@ -991,8 +991,11 @@ Use "view XX" where XX is a number to view information about link XX.
|
|||
if netcache.is_cache_valid(link_url):
|
||||
last_modified = netcache.cache_last_modified(link_url)
|
||||
link_renderer = self.get_renderer(link_url)
|
||||
link_title = link_renderer.get_page_title()
|
||||
print(link_title)
|
||||
if link_renderer:
|
||||
link_title = link_renderer.get_page_title()
|
||||
print(link_title)
|
||||
else:
|
||||
print("Empty cached version")
|
||||
print("Last cached on %s"%time.ctime(last_modified))
|
||||
else:
|
||||
print("No cached version for this link")
|
||||
|
|
Loading…
Reference in New Issue