Fix ThemeInfoProxy::LoadTheme()
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 12 May 2020 07:30:05 +0000 (16:30 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 25 May 2020 04:28:15 +0000 (13:28 +0900)
Return null when the requested theme does not exist.

Change-Id: Ic5a7f710992c21efe2c3bf0f5248868b6fa872ee
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/theme_provider/theme_info_proxy.cc

index 6e0dde7..03b0214 100644 (file)
@@ -18,7 +18,11 @@ ThemeInfoProxy::ThemeInfoProxy(const std::string& db_path) {
 
 std::shared_ptr<loader::ThemeInfo> ThemeInfoProxy::LoadTheme(
     const std::string& id) {
-  return std::make_shared<loader::ThemeInfo>(db_manager_->Select(id));
+  tizen_base::Bundle b = db_manager_->Select(id);
+  if (b.GetCount())
+    return std::make_shared<loader::ThemeInfo>(b);
+  else
+    return {};
 }
 
 bool ThemeInfoProxy::SaveTheme(const loader::ThemeInfo& info) {