Skip to content

fix: guard nil pointer on property not found and add missing return in GetPods - #2784

Open
AruneshDwivedi wants to merge 1 commit into
openyurtio:masterfrom
AruneshDwivedi:fix/device-nil-guard-2779
Open

fix: guard nil pointer on property not found and add missing return in GetPods#2784
AruneshDwivedi wants to merge 1 commit into
openyurtio:masterfrom
AruneshDwivedi:fix/device-nil-guard-2779

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

Fixes #2779 and #2771

device_controller: add continue after NotFoundErr branch to prevent
dereferencing nil actualProperty which caused a panic in the
DeviceProperties map write.

otaupdate: add missing return after WriteErr in GetPods handler.
When EncodePods fails, the handler now returns instead of falling
through to WriteJSONResponse with nil data.

…n GetPods

device_controller: add continue after NotFoundErr branch to prevent
dereferencing nil actualProperty which caused a panic in
the DeviceProperties map write. Fixes openyurtio#2779.

otaupdate: add missing return after WriteErr in GetPods handler.
When EncodePods fails, the handler now returns instead of falling
through to WriteJSONResponse with nil data, which would write an
empty but valid JSON response instead of the intended error.

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
@AruneshDwivedi
AruneshDwivedi requested a review from a team as a code owner August 29, 2026 07:50
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Nil pointer dereference when IsNotFoundErr path falls through

1 participant