about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorideal <idealities@gmail.com>2021-03-07 12:21:14 +0800
committerideal <idealities@gmail.com>2021-03-07 12:21:14 +0800
commit78034ec77a510f466901e40180d76578df120d35 (patch)
tree5e744128653f52c95c5e4069a7bfc124915991cf /ranger
parentcd17ea8c1d2cd89754f625df25134f00c7227b65 (diff)
downloadranger-78034ec77a510f466901e40180d76578df120d35.tar.gz
Fix crash if man is not installed when hit '?' and 'm'.
On some systems (e.g. archlinuxarm) man is not installed by default, hit
'?' and 'm' will cause ranger crashed, showing:
AttributeError: 'NoneType' object has no attribute 'poll'.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index adfbe94d..c458da11 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -974,6 +974,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             if process.poll() != 16:
                 return
         process = self.run(['man', 'ranger'])
+        if process is None:
+            self.notify("Show manpage failed, check if man is installed", bad=True)
+            return
         if process.poll() == 16:
             self.notify("Could not find manpage.", bad=True)