diff --git a/src/control/control.cpp b/src/control/control.cpp index 1187200dd77..d7d4db46d60 100644 --- a/src/control/control.cpp +++ b/src/control/control.cpp @@ -148,11 +148,12 @@ QSharedPointer ControlDoublePrivate::getControl( auto pControl = it.value().lock(); if (pControl) { // Control object already exists - VERIFY_OR_DEBUG_ASSERT(!pCreatorCO) { + if (pCreatorCO) { qWarning() << "ControlObject" << key.group << key.item << "already created"; + DEBUG_ASSERT(!"pCreatorCO != nullptr, ControlObject already created"); return nullptr; } return pControl; @@ -311,8 +312,9 @@ double ControlDoublePrivate::getParameterForValue(double value) const { double ControlDoublePrivate::getParameterForMidi(double midiParam) const { QSharedPointer pBehavior = m_pBehavior; - VERIFY_OR_DEBUG_ASSERT(pBehavior) { - qWarning() << "Cannot set" << m_key << "by Midi"; + if (!pBehavior) { + qWarning() << "Cannot get" << m_key << "for Midi"; + DEBUG_ASSERT(!"pBehavior == nullptr, getParameterForMidi is returning 0"); return 0; } return pBehavior->midiToParameter(midiParam); @@ -320,8 +322,9 @@ double ControlDoublePrivate::getParameterForMidi(double midiParam) const { void ControlDoublePrivate::setValueFromMidi(MidiOpCode opcode, double midiParam) { QSharedPointer pBehavior = m_pBehavior; - VERIFY_OR_DEBUG_ASSERT(pBehavior) { - qWarning() << "Cannot set" << m_key << "by Midi"; + if (!pBehavior) { + qWarning() << "Cannot set" << m_key << "from Midi"; + DEBUG_ASSERT(!"pBehavior == nullptr, abort setValueFromMidi()"); return; } pBehavior->setValueFromMidi(opcode, midiParam, this); @@ -329,8 +332,9 @@ void ControlDoublePrivate::setValueFromMidi(MidiOpCode opcode, double midiParam) double ControlDoublePrivate::getMidiParameter() const { QSharedPointer pBehavior = m_pBehavior; - VERIFY_OR_DEBUG_ASSERT(pBehavior) { - qWarning() << "Cannot get" << m_key << "by Midi"; + if (!pBehavior) { + qWarning() << "Cannot get" << m_key << "as Midi"; + DEBUG_ASSERT(!"pBehavior == nullptr, getMidiParameter() is returning 0"); return 0; } return pBehavior->valueToMidiParameter(get());