#471: speculative fix

This commit is contained in:
Cameron Kaiser 2018-01-28 15:06:39 -08:00
parent ca84d557fc
commit 57bc570cc9
1 changed files with 1 additions and 0 deletions

View File

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