From: SangYong Park Date: Mon, 24 May 2021 02:37:21 +0000 (+0900) Subject: Add null check for avoiding std::string crash X-Git-Tag: accepted/tizen/4.0/unified/20210524.092503^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_4.0;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Add null check for avoiding std::string crash ewk_view_url_get() can return nullptr, but std::string constructor with nullptr causes crash. so add null check before construction. Change-Id: I76e32366a27d307e82778150d5235696f68f99a9 Signed-off-by: SangYong Park --- diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc index db7de49..0f209cd 100755 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -967,7 +967,8 @@ void WebViewImpl::InitRotaryEventCallback() { } std::string WebViewImpl::GetUrl() { - return std::string(ewk_view_url_get(ewk_view_)); + auto url = ewk_view_url_get(ewk_view_); + return std::string(url ? url : ""); } Evas_Object* WebViewImpl::evas_object() const {