From 4f6d5a3694b2c8b3e5672dbbaeacd785d97fe358 Mon Sep 17 00:00:00 2001 From: sungwon2han Date: Wed, 23 Sep 2015 15:18:59 +0900 Subject: [PATCH] Browser exit when load history items [Issue#] NA [Problem] Browser cannot get history info from browser-provider [Cause] browser-provider issue [Solution] add error check routine for browser-provider Change-Id: I12368bc9394e8115c4debfa9b72d8aa5a9aa9f5c Signed-off-by: sungwon2han --- services/HistoryService/HistoryService.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/services/HistoryService/HistoryService.cpp b/services/HistoryService/HistoryService.cpp index 1d93507..c60d669 100644 --- a/services/HistoryService/HistoryService.cpp +++ b/services/HistoryService/HistoryService.cpp @@ -214,14 +214,18 @@ std::shared_ptr HistoryService::getMostVisitedHistoryItems() history->setTitle(std::string(history_info.title ? history_info.title : "")); //thumbail - std::shared_ptr hi = std::make_shared(); - hi->imageType = tools::BrowserImage::ImageTypePNG; - hi->width = history_info.thumbnail_width; - hi->height = history_info.thumbnail_height; - hi->dataSize = history_info.thumbnail_length; - hi->imageData = (void*)malloc(history_info.thumbnail_length); - memcpy(hi->imageData, (void*)history_info.thumbnail, history_info.thumbnail_length); - history->setThumbnail(hi); + if (history_info.thumbnail_length != -1) { + std::shared_ptr hi = std::make_shared(); + hi->imageType = tools::BrowserImage::ImageTypePNG; + hi->width = history_info.thumbnail_width; + hi->height = history_info.thumbnail_height; + hi->dataSize = history_info.thumbnail_length; + hi->imageData = (void*)malloc(history_info.thumbnail_length); + memcpy(hi->imageData, (void*)history_info.thumbnail, history_info.thumbnail_length); + history->setThumbnail(hi); + } else { + BROWSER_LOGD("history thumbnail lenght is -1"); + } ret_history_list->push_back(history); } -- 2.7.4