Browse Source

macOS: Fix a crash in getMainScreenHeight() when no screens are available

tags/2021-05-28
ed 6 years ago
parent
commit
165654e73c
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm

+ 3
- 0
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -50,6 +50,9 @@ namespace juce
//==============================================================================
static CGFloat getMainScreenHeight() noexcept
{
if ([[NSScreen screens] count] == 0)
return 0.0f;
return [[[NSScreen screens] objectAtIndex: 0] frame].size.height;
}


Loading…
Cancel
Save