From: Seungkeun Lee Date: Tue, 21 Apr 2015 06:07:49 +0000 (+0900) Subject: NULL Check the ApplicationData properties before use X-Git-Tag: accepted/tizen/tv/20150521.074650^2~56^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0593e84a087aeb7af2ecbd271fe4c8422fc95686;p=platform%2Fframework%2Fweb%2Fnwrt.git NULL Check the ApplicationData properties before use Change-Id: I8ba85c83ddab0b6bb57e7acf1f953aaabbd973bb --- diff --git a/src/runtime/web_application.cc b/src/runtime/web_application.cc index 23f336f..d224622 100755 --- a/src/runtime/web_application.cc +++ b/src/runtime/web_application.cc @@ -217,7 +217,8 @@ void WebApplication::Resume() { if (view_stack_.size() > 0 && view_stack_.front() != NULL) view_stack_.front()->SetVisibility(true); - if (app_data_->setting_info()->background_support_enabled()) { + if (app_data_->setting_info() != NULL && + app_data_->setting_info()->background_support_enabled()) { return; } @@ -231,7 +232,8 @@ void WebApplication::Suspend() { if (view_stack_.size() > 0 && view_stack_.front() != NULL) view_stack_.front()->SetVisibility(false); - if (app_data_->setting_info()->background_support_enabled()) { + if (app_data_->setting_info() != NULL && + app_data_->setting_info()->background_support_enabled()) { LoggerD("gone background (backgroud support enabed)"); return; } @@ -304,7 +306,10 @@ void WebApplication::OnOrientationLock(WebView* view, if (view_stack_.front() != view) return; - auto orientaion_setting = app_data_->setting_info()->screen_orientation(); + auto orientaion_setting = app_data_->setting_info() != NULL ? + app_data_->setting_info()->screen_orientation() : + // TODO(sngn.lee): check default value + wgt::parse::SettingInfo::AUTO; if (orientaion_setting != wgt::parse::SettingInfo::AUTO) { return; } @@ -317,7 +322,9 @@ void WebApplication::OnOrientationLock(WebView* view, } void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { - bool enabled = app_data_->setting_info()->hwkey_enabled(); + bool enabled = app_data_->setting_info() != NULL ? + app_data_->setting_info()->hwkey_enabled() : + true; if (enabled && kKeyNameBack == keyname) { view->EvalJavascript(kBackKeyEventScript); } @@ -357,7 +364,9 @@ void WebApplication::OnLowMemory() { } bool WebApplication::OnContextMenuDisabled(WebView* /*view*/) { - return !app_data_->setting_info()->context_menu_enabled(); + return !(app_data_->setting_info() != NULL ? + app_data_->setting_info()->context_menu_enabled() : + true); } void WebApplication::OnLoadStart(WebView* view) {