Skip to content

Fix handling of container ports for MacOS Docker API#2380

Merged
pablomendezroyo merged 1 commit intodevelopfrom
pablo/check-ports-exists
Feb 20, 2026
Merged

Fix handling of container ports for MacOS Docker API#2380
pablomendezroyo merged 1 commit intodevelopfrom
pablo/check-ports-exists

Conversation

@pablomendezroyo
Copy link
Copy Markdown
Contributor

@pablomendezroyo pablomendezroyo commented Feb 20, 2026

Context

This pull request addresses the issue of handling null values for container ports returned by the Docker API on MacOS. It ensures that the application can gracefully manage scenarios where the ports information is not available.

ERROR  Error on updateSystemPackages TypeError: Cannot read properties of null (reading 'filter')
    at ensureUniquePortsFromDockerApi (file:///usr/src/app/packages/dockerApi/dist/utils.js:101:10)
    at parseContainerInfo (file:///usr/src/app/packages/dockerApi/dist/list/parseContainerInfo.js:41:16)

Approach

The solution modifies the parseContainerInfo function to check for null values in the container ports before processing them, preventing potential errors and ensuring stability.

Test instructions

  1. Run the application on MacOS with Docker.
  2. Create a container that returns null for ports.
  3. Verify that the application handles the null value without crashing and that the rest of the container information is processed correctly.

@pablomendezroyo pablomendezroyo requested a review from a team as a code owner February 20, 2026 09:07
@github-actions github-actions bot temporarily deployed to commit February 20, 2026 09:08 Inactive
@github-actions
Copy link
Copy Markdown

@pablomendezroyo pablomendezroyo merged commit 7db540f into develop Feb 20, 2026
9 checks passed
@pablomendezroyo pablomendezroyo deleted the pablo/check-ports-exists branch February 20, 2026 09:16
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.

1 participant