]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Fix crash when click on unconfigured key
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 12 Aug 2016 14:12:54 +0000 (16:12 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 12 Aug 2016 14:12:54 +0000 (16:12 +0200)
music_sampler/key.py

index 983c5a6c263e064209f0a20601d4e750058d497f..ce2f45bafd8bf9ca9cbdf47c48070eb99615e4cb 100644 (file)
@@ -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