widgets.browserview: Try to fix crash
When running ranger with two directories and using a command with macros, this
crash happens. To reproduce, run this and then type "yp"
ranger /usr/bin /var/tmp
Traceback was:
Ranger version: 1.5.0, executed with python 3.2.2
Locale: en_US.UTF-8
Current file: /usr/lib
Traceback (most recent call last):
File "/home/common/archive/repos/ranger/ranger/core/main.py", line 103, in main
fm.loop()
File "/home/common/archive/repos/ranger/ranger/core/fm.py", line 202, in loop
ui.handle_input()
File "/home/common/archive/repos/ranger/ranger/gui/ui.py", line 210, in handle_input
self.handle_key(key)
File "/home/common/archive/repos/ranger/ranger/gui/ui.py", line 146, in handle_key
self.press(key)
File "/home/common/archive/repos/ranger/ranger/gui/ui.py", line 161, in press
quantifier=keybuffer.quantifier)
File "/home/common/archive/repos/ranger/ranger/core/actions.py", line 111, in execute_console
string = self.substitute_macros(string, additional=macros)
File "/home/common/archive/repos/ranger/ranger/core/actions.py", line 115, in substitute_macros
return _MacroTemplate(string).safe_substitute(self._get_macros(),
File "/home/common/archive/repos/ranger/ranger/core/actions.py", line 153, in _get_macros
macros[i + 'f'] = shell_quote(tab_dir.pointed_obj.path)
AttributeError: 'NoneType' object has no attribute 'path'