Fix crash in litehtml_viewer when <base> tag has no href
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 6 Aug 2019 08:46:01 +0000 (10:46 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 6 Aug 2019 08:46:01 +0000 (10:46 +0200)
src/plugins/litehtml_viewer/lh_widget.cpp

index 903c496..ece90b5 100644 (file)
@@ -139,7 +139,11 @@ void lh_widget::set_base_url(const litehtml::tchar_t* base_url)
 {
        debug_print("lh_widget set_base_url '%s'\n",
                        (base_url ? base_url : "(null)"));
-       m_base_url = base_url;
+       if (base_url)
+               m_base_url = base_url;
+       else
+               m_base_url.clear();
+
        return;
 }