Closed wallyqs closed 1 month ago
This (the isEmptyRequest
) protects the API by a side effect.
The actual fix would be to check if pointer is nil before using its fields, as you could still cause panic by sending a field with a typo - not empty, yet Placement
would be nil, and cause panic again. At least without strict marshaling.
I will check the other APIs. This fix is fine as a hotfix, but I would prefer to follow up later if you agree with above @derekcollison .
@Jarema ok to merge this one and we will follow up with separate PR?
Side effect from https://github.com/nats-io/nats-server/pull/5956 some clients/natscli send empty objects to trigger the meta leader step down.