add a log message to notify separately that provider key is empty or invalid format 99/124899/2 accepted/tizen/unified/20170414.164132 submit/tizen/20170414.101325
authorchanywa <cbible.kim@samsung.com>
Thu, 13 Apr 2017 03:41:44 +0000 (12:41 +0900)
committerchanywa <cbible.kim@samsung.com>
Thu, 13 Apr 2017 05:38:22 +0000 (14:38 +0900)
Change-Id: Ia25c1f778c4a97e7ce8f73d6c3396d03d48d97ed

src/here_manager.cpp

index ff147b0..e3f9636 100644 (file)
@@ -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;
 }