diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index d59f039241..096bb8f0f3 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -1090,7 +1090,15 @@ public: static float getMousePressure (NSEvent* e) noexcept { - return (float) e.pressure; + @try + { + if (e.type != NSMouseEntered && e.type != NSMouseExited) + return (float) e.pressure; + } + @catch (NSException* e) {} + @finally {} + + return 0.0f; } static Point getMousePos (NSEvent* e, NSView* view)