summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/surfaces/generic_midi/midicontrollable.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc
index 488ac557bb..d36ccefd44 100644
--- a/libs/surfaces/generic_midi/midicontrollable.cc
+++ b/libs/surfaces/generic_midi/midicontrollable.cc
@@ -122,7 +122,11 @@ MIDIControllable::set_controllable (Controllable* c)
controllable = c;
- last_controllable_value = controllable->get_value();
+ if (controllable) {
+ last_controllable_value = controllable->get_value();
+ } else {
+ last_controllable_value = 0.0f; // is there a better value?
+ }
if (controllable) {
controllable->Destroyed.connect (controllable_death_connection, MISSING_INVALIDATOR,