You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/08/03 02:48:44 UTC

[GitHub] [apisix-ingress-controller] okaybase commented on a change in pull request #613: fix: avoid nil pointer dereference

okaybase commented on a change in pull request #613:
URL: https://github.com/apache/apisix-ingress-controller/pull/613#discussion_r681393977



##########
File path: pkg/apisix/resource_test.go
##########
@@ -40,7 +40,10 @@ func TestItemUnmarshalJSON(t *testing.T) {
 }
 `
 	err = json.Unmarshal([]byte(emptyData), &items)
-	assert.Equal(t, err.Error(), "unexpected non-empty object")
+	assert.True(t,

Review comment:
       When err is nil, will trigger panic. Add nil value judgment to avoid panic.




-- 
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: notifications-unsubscribe@apisix.apache.org

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