ningyougang commented on code in PR #516:
URL: https://github.com/apache/openwhisk-cli/pull/516#discussion_r950640992


##########
commands/util.go:
##########
@@ -604,16 +604,20 @@ func getChildValueStrings(keyValueArr whisk.KeyValueArr, 
key string, childKey st
        return res
 }
 
-func getValueFromJSONResponse(field string, response map[string]interface{}) 
interface{} {
+func getValueFromJSONResponse(field string, response interface{}) interface{} {
        var res interface{}
 
-       for key, value := range response {
-               if key == field {
-                       res = value
-                       break
+       if result, ok := response.(map[string]interface{}); ok {
+               for key, value := range result {
+                       if key == field {
+                               res = value
+                               break
+                       }
                }
        }
-
+       if result, ok := response.([]interface{}); ok {

Review Comment:
   @dgrove-oss yes, you right, need to return "" when it is array.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to