Bug 191361

Summary: WebKit part crashes when createNewWindow signal is not connected
Product: [Unmaintained] kdelibs Reporter: Paweł Prażak <kojot350>
Component: kdewebkitAssignee: webkit-devel
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Paweł Prażak 2009-05-02 17:24:29 UTC
Version:            (using Devel)
Compiler:          gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291] 
OS:                Linux
Installed from:    Compiled sources

When createNewWindow signal is not connected WebKit part crashes (in debugging code).

I know that browser should connect this signal to work properly, but part should not crash as well.

this is a very simple patch

Index: part/webpage.cpp
===================================================================
--- part/webpage.cpp    (revision 961330)
+++ part/webpage.cpp    (working copy)
@@ -80,7 +80,10 @@
                                                      KParts::WindowArgs(), &part);
     WebKitPart *webKitPart = qobject_cast<WebKitPart*>(part);
     if (!webKitPart) {
-        kDebug() << "got NOT a WebKitPart but a" << part->metaObject()->className();
+        if (part)
+            kDebug() << "got NOT a WebKitPart but a" << part->metaObject()->className();
+        else
+            kDebug() << "part is null";
         return 0;
     }
     return webKitPart->view()->page();
Comment 1 Urs Wolfer 2009-05-02 22:18:30 UTC
SVN commit 962657 by uwolfer:

Prevent crash when part is null.
Patch by Paweł Prażak, thanks.
BUG:191361

 M  +5 -1      webpage.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=962657
Comment 2 Dario Andres 2010-11-18 14:53:08 UTC
[Comment from a bug triager]
Moving old kdewebkit bug reports to kdelibs/kdewebkit. Sorry about the noise