Check for undefined in updateOrCreateComponent of components.js / components.ts
## Bug report

### Required System information

- Node.js version: v18.18.2
- NPM version: 8.3.1
- Strapi version: 4.25.11
- Database: MySQL
- Operating system: Windows 11
- Is your project Javascript or Typescript: JavaScript

<!-- Did you know you can run `yarn strapi report` or `npm run strapi report` to get this information easier? -->

### Describe the bug

The function updateOrCreateComponent checks for the value argument to not be null, but not undefined. In this case it throws the following error: "Cannot use 'in' operator to search for 'id' in undefined"

I would suggest to add another check for undefined to avoid this issue.

### Steps to reproduce the behavior

1. Call updateOrCreateComponent with an undefined value.
2. See the error

### Expected behavior

I would expect to check for undefined value and return null

### Code snippets
My recommendation is to add the following check:
```
const updateOrCreateComponent = (componentUID, value) => {
  if (value === null || value === undefined) {
    return null;
  }
  if ("id" in value && typeof value.id !== "undefined") {
    return updateComponent(componentUID, { id: value.id }, value);
  }
  return createComponent(componentUID, value);
};
```
