From 57bc570cc9f96721c9f7b36a04f4e1dde5459b31 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Sun, 28 Jan 2018 15:06:39 -0800 Subject: [PATCH] #471: speculative fix --- widget/cocoa/nsNativeThemeCocoa.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index 146977d35..60c43c986 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -3391,6 +3391,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, // draw a focus ring if (eventState.HasState(NS_EVENT_STATE_FOCUS)) { NSGraphicsContext* savedContext = [NSGraphicsContext currentContext]; + if (MOZ_UNLIKELY(!savedContext)) break; // speculative fix issue 471 [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES]]; CGContextSaveGState(cgContext); NSSetFocusRingStyle(NSFocusRingOnly);