From 61a76710d1accca676ae2c242e60b418720d0c45 Mon Sep 17 00:00:00 2001 From: chanywa Date: Thu, 13 Apr 2017 12:41:44 +0900 Subject: [PATCH] add a log message to notify separately that provider key is empty or invalid format Change-Id: Ia25c1f778c4a97e7ce8f73d6c3396d03d48d97ed --- src/here_manager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/here_manager.cpp b/src/here_manager.cpp index ff147b0..e3f9636 100644 --- a/src/here_manager.cpp +++ b/src/here_manager.cpp @@ -249,6 +249,11 @@ here_error_e HereManager::SetCredentials(const char *szKey) nCodeStart = strKey.find("/"); + if (strKey.length() == 0) { + MAPS_LOGE("[error] Key type fault : Key is empty."); + return HERE_ERROR_INVALID_PARAMETER; + } + if(nCodeStart == 0 || nCodeStart >= (strKey.length()-1)) { MAPS_LOGE("[error] Key type fault : Key type should be as like XXXXX/YYYYY"); return HERE_ERROR_INVALID_PARAMETER; @@ -274,8 +279,6 @@ here_error_e HereManager::SetCredentials(const char *szKey) if(!ApplicationContext::GetInstance().Initialize(strAppCode, strAppId, strRequestAppId)) return HERE_ERROR_INVALID_OPERATION; - //MAPS_LOGD("[success] credential setted to 'XXXXX/XXXXX'"); - return HERE_ERROR_NONE; } @@ -295,8 +298,6 @@ here_error_e HereManager::GetCredentials(char **szKey) if (*szKey == NULL) return HERE_ERROR_INVALID_OPERATION; - //MAPS_LOGD("current credential : %s", *szKey); - return HERE_ERROR_NONE; } -- 2.34.1