Browse Source

Avoided a possible null pointer in KeyMappingEditorComponent

tags/2021-05-28
jules 9 years ago
parent
commit
d410b6d13d
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp

+ 8
- 5
modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp View File

@@ -176,13 +176,16 @@ public:
static void keyChosen (int result, ChangeKeyButton* button) static void keyChosen (int result, ChangeKeyButton* button)
{ {
if (result != 0 && button != nullptr && button->currentKeyEntryWindow != nullptr)
if (button != nullptr && button->currentKeyEntryWindow != nullptr)
{ {
button->currentKeyEntryWindow->setVisible (false);
button->setNewKey (button->currentKeyEntryWindow->lastPress, false);
}
if (result != 0)
{
button->currentKeyEntryWindow->setVisible (false);
button->setNewKey (button->currentKeyEntryWindow->lastPress, false);
}
button->currentKeyEntryWindow = nullptr;
button->currentKeyEntryWindow = nullptr;
}
} }
void assignNewKey() void assignNewKey()


Loading…
Cancel
Save