From 7df12958bed6544b36bc946cdbb185ff2011733c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 12 Aug 2016 16:12:54 +0200 Subject: [PATCH] Fix crash when click on unconfigured key --- music_sampler/key.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/music_sampler/key.py b/music_sampler/key.py index 983c5a6..ce2f45b 100644 --- a/music_sampler/key.py +++ b/music_sampler/key.py @@ -290,8 +290,9 @@ class Key(ButtonBehavior, Widget): # Helpers @property def repeat_delay(self): - if 'repeat_delay' in self.key.config['properties']: - return self.key.config['properties']['repeat_delay'] + if hasattr(self, 'config') and\ + 'repeat_delay' in self.config['properties']: + return self.config['properties']['repeat_delay'] else: return 0 -- 2.41.0