Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=7223
[WebKit-https.git] / WebCore / bridge / mac / FrameMac.mm
index cbb09b0106bccb3b37b56d0c4c410013a7080517..9e54d3e910de953ac402fde51a5fd8d3f8f37a08 100644 (file)
@@ -879,11 +879,14 @@ NSView *FrameMac::nextKeyViewInFrame(Node *node, KWQSelectionDirection direction
         if (renderer->isWidget()) {
             RenderWidget *renderWidget = static_cast<RenderWidget *>(renderer);
             Widget *widget = renderWidget->widget();
         if (renderer->isWidget()) {
             RenderWidget *renderWidget = static_cast<RenderWidget *>(renderer);
             Widget *widget = renderWidget->widget();
+            if (!widget)
+                continue;
+            
             FrameView *childFrameWidget = widget->isFrameView() ? static_cast<FrameView *>(widget) : 0;
             NSView *view = nil;
             if (childFrameWidget)
                 view = Mac(childFrameWidget->frame())->nextKeyViewInFrame(0, direction);
             FrameView *childFrameWidget = widget->isFrameView() ? static_cast<FrameView *>(widget) : 0;
             NSView *view = nil;
             if (childFrameWidget)
                 view = Mac(childFrameWidget->frame())->nextKeyViewInFrame(0, direction);
-            else if (widget)
+            else
                 view = widget->getView();
             if (view)
                 return view;
                 view = widget->getView();
             if (view)
                 return view;