1
0
Fork 0
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:
ed 2019-05-17 17:12:52 +01:00
parent 81fbbdfe20
commit 3b36c3e198

View file

@ -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;
}
}
}