Fix segfault in xwidget when there is no title

* src/xwidget.c (Fxwidget_webkit_title): Pass emptry string when no
title is returned (bug#43989).
This commit is contained in:
Jeff Walsh 2020-10-15 09:55:29 +02:00 committed by Lars Ingebrigtsen
parent 730ea4c370
commit 2970d73a71

View file

@ -793,7 +793,9 @@ DEFUN ("xwidget-webkit-title",
WEBKIT_FN_INIT ();
#ifdef USE_GTK
WebKitWebView *wkwv = WEBKIT_WEB_VIEW (xw->widget_osr);
return build_string (webkit_web_view_get_title (wkwv));
const gchar *title = webkit_web_view_get_title (wkwv);
return build_string (title ? title : "");
#elif defined NS_IMPL_COCOA
return nsxwidget_webkit_title (xw);
#endif