From 8724cd5e44207e7bc0af77da72b2cd8e1a2fd5c6 Mon Sep 17 00:00:00 2001 From: nfnty Date: Wed, 25 Jan 2017 14:36:38 +0100 Subject: container.settings: Do not try to access key before being set Fixes #446 --- ranger/container/settings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 4744de4d..f4679453 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -140,8 +140,7 @@ class Settings(SignalDispatcher, FileManagerAware): signal.value = None elif name == 'use_preview_script': - if self._settings['preview_script'] is None and value \ - and self.fm.ui.is_on: + if self._settings.get('preview_script') is None and value and self.fm.ui.is_on: self.fm.notify("Preview script undefined or not found!", bad=True) -- cgit 1.4.1-2-gfad0