From 2d3f4669ea2c10afbff1045dde66a5b73f0f27af Mon Sep 17 00:00:00 2001 From: leerang song Date: Mon, 21 Oct 2013 20:14:27 +0900 Subject: Check the return value of livebox_service_lb_script_path [Issue#] P131017-03896 [Problem] web-provider crash occured. [Cause] livebox_service_lb_script_path returns char*. Sometimes livebox_service_lb_script_path returns NULL. But the variable of url that receives return is std::string. [Solution] The variable of url changes std::sting to char* and checks whether Null, or not. If path is NULL, URL is returned as the default parameter. Change-Id: Ie7a30694a438700355742b79db6c346e8adbcd30 --- src/Plugin/AppBoxPlugin/AppBoxRenderView.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Plugin/AppBoxPlugin/AppBoxRenderView.cpp b/src/Plugin/AppBoxPlugin/AppBoxRenderView.cpp index ad396da..72113d6 100755 --- a/src/Plugin/AppBoxPlugin/AppBoxRenderView.cpp +++ b/src/Plugin/AppBoxPlugin/AppBoxRenderView.cpp @@ -337,22 +337,31 @@ std::string AppBoxRenderView::getAppId(std::string& boxId) std::string AppBoxRenderView::getStartUrl(UrlType type, std::string& defaultParams) { - std::string url; + const char* path; switch (type) { case URL_TYPE_BOX: - url = livebox_service_lb_script_path(m_boxId.c_str()); + path = livebox_service_lb_script_path(m_boxId.c_str()); break; case URL_TYPE_PD: - url = livebox_service_pd_script_path(m_boxId.c_str()); + path = livebox_service_pd_script_path(m_boxId.c_str()); break; default: LogD("no available type"); } + std::string startUrl; + if (path) { + LogD("path : %s", path); + startUrl = path; + } else { + // TODO In this case, fallback page will be loaded. + LogE("Fail to get service lib script path"); + } + // add default parameters to start url - url += defaultParams; + startUrl += defaultParams; - return url; + return startUrl; } Evas_Object* AppBoxRenderView::getCurrentSnapShot() -- cgit v1.2.3