mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a potential crash in ApplicationCommandManager::findDefaultComponentTarget()
This commit is contained in:
parent
81fbbdfe20
commit
3b36c3e198
1 changed files with 6 additions and 3 deletions
|
|
@ -254,10 +254,13 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget(
|
|||
{
|
||||
if (auto* activeWindow = TopLevelWindow::getActiveTopLevelWindow())
|
||||
{
|
||||
c = activeWindow->getPeer()->getLastFocusedSubcomponent();
|
||||
if (auto* peer = activeWindow->getPeer())
|
||||
{
|
||||
c = peer->getLastFocusedSubcomponent();
|
||||
|
||||
if (c == nullptr)
|
||||
c = activeWindow;
|
||||
if (c == nullptr)
|
||||
c = activeWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue