solve a crash when calling less after a mailto link

This commit is contained in:
Lionel Dricot 2022-02-22 13:24:36 +01:00
parent 4f56a85e28
commit 6d87b2f4bc
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,8 @@
# Offpunk History
## 0.5 - Unreleased
- Avoid deprecated SSL methods (thanks Phoebos for the report)
## 0.4 - Feb 21st 2022
UPGRADE: Users who subscribed to pages before 0.4 should run once the command "list subscribe subscribed". Without that, the subscribed list will be seen as a normal list by sync.
- New list command : "list freeze" and "list suscribe"

View File

@ -1236,7 +1236,9 @@ class GeminiItem():
return self.mime
elif self.is_cache_valid():
path = self.get_cache_path()
if os.path.isdir(path):
if self.scheme == "mailto":
mime = "mailto"
elif os.path.isdir(path):
mime = "Local Folder"
elif path.endswith(".gmi"):
mime = "text/gemini"
@ -2760,7 +2762,7 @@ Use "less full" to see a complete html page instead of the article view.
(the "full" argument has no effect on Gemtext content but doesnt restore position)."""
if self.gi and args and args[0] == "full":
self._go_to_gi(self.gi,readable=False)
elif self.gi.is_cache_valid():
elif self.gi.is_cache_valid() and self.gi.scheme not in ["mailto"]:
less_cmd(self._get_active_tmpfile(),histfile=self.less_histfile)
else:
self.do_go(self.gi.url)