From dbc513498034e1c230d0088c931690e22e50c444 Mon Sep 17 00:00:00 2001 From: "peterlubczynski%netscape.com" Date: Wed, 11 Apr 2001 05:29:36 +0000 Subject: [PATCH] Fix for crash with full-page plugins on Mac bug 74934 r=kmcclusk sr=roc+moz --- view/src/nsView.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp index cb53f92af4b0..6460f941ebe2 100644 --- a/view/src/nsView.cpp +++ b/view/src/nsView.cpp @@ -198,17 +198,15 @@ nsIView* nsView::GetViewFor(nsIWidget* aWidget) // The widget's client data points back to the owning view if (aWidget && NS_SUCCEEDED(aWidget->GetClientData(clientData))) { view = (nsIView*)clientData; - - if (nsnull != view) { -#ifdef NS_DEBUG - // Verify the pointer is really a view - nsView* widgetView; - NS_ASSERTION((NS_SUCCEEDED(view->QueryInterface(NS_GET_IID(nsIView), (void **)&widgetView))) && - (widgetView == view), "bad client data"); -#endif - } + + nsISupports* data = (nsISupports*)clientData; + + if (nsnull != data) { + if (NS_FAILED(data->QueryInterface(NS_GET_IID(nsIView), (void **)&view))) { + return nsnull; // return null if client data isn't a view + } + } } - return view; }