### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

18

### What operating system are you using?

macOS

### Operating System Version

Mojave

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

https://developer.apple.com/documentation/foundation/nsdistributednotificationcenter/1414136-addobserver
notificationName: _"When nil, the notification center doesn’t use a notification’s name to decide whether to deliver it to the observer."_

Get a running list of all notifications from macOS (no name filter):

```
[com.resilio.Sync.FeOnExtPingAliveNotifiaction]
[com.apple.backup.exclusionschanged]
[com.resilio.Sync.FeOnExtPingAliveNotifiaction]
[com.apple.backup.prefschanged]
[com.resilio.Sync.FeOnExtPingAliveNotifiaction]
[com.resilio.Sync.FeOnExtPingAliveNotifiaction]
[com.resilio.Sync.FeOnExtPingAliveNotifiaction]

```

### 

### Actual Behavior

Throws an error.

`> node-nsdnc@1.0.0 start
> electron .

App threw an error during load
TypeError: Error processing argument at index 0, conversion failure from null
    at Object.<anonymous> (/node-electron-NSDNC.git/main.js:6:29)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
    at loadApplicationPackage (/node-electron-NSDNC.git/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:110:16)
    at Object.<anonymous> (/node-electron-NSDNC.git/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:222:9)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)


### Testcase Gist URL

https://gist.github.com/knev/0cd2a52a0aebe8e35904641df47f60d7

### Additional Information

Electron file: `shell/browser/api/electron_api_system_preferences_mac.mm`

It is obvious that `SysUTF8ToNSString(name)` will throw an error when name is `nil`. `nil` is a valid input.

```
int SystemPreferences::DoSubscribeNotification(
    const std::string& name,
    const NotificationCallback& callback,
    NotificationCenterKind kind) {
  int request_id = g_next_id++;
  __block NotificationCallback copied_callback = callback;

  g_id_map[request_id] = [GetNotificationCenter(kind)
      addObserverForName:base::SysUTF8ToNSString(name)
                  object:nil
                   queue:nil
              usingBlock:^(NSNotification* notification) {
                std::string object = "";
                if ([notification.object isKindOfClass:[NSString class]]) {
                  object = base::SysNSStringToUTF8(notification.object);
                }

                if (notification.userInfo) {
                  copied_callback.Run(
                      base::SysNSStringToUTF8(notification.name),
                      NSDictionaryToDictionaryValue(notification.userInfo),
                      object);
                } else {
                  copied_callback.Run(
                      base::SysNSStringToUTF8(notification.name),
                      base::DictionaryValue(), object);
                }
              }];
  return request_id;
}
```
shell/browser/api/electron_api_system_preferences.h
NotificationCenterKind kind);
  void DoUnsubscribeNotification(int request_id, NotificationCenterKind kind);
#endif
 private:
#if BUILDFLAG(IS_WIN)
  
  static LRESULT CALLBACK WndProcStatic(HWND hwnd,
                                        UINT message,
                                        WPARAM wparam,
                                        LPARAM lparam);
  LRESULT CALLBACK WndProc(HWND hwnd,
                           UINT message,
                           WPARAM wparam,
                           LPARAM lparam);
  
  ATOM atom_;
  
  HMODULE instance_;
  
  HWND window_;
  std::string current_color_;
  bool invertered_color_scheme_ = false;
  bool high_contrast_color_scheme_ = false;
  std::unique_ptr<gfx::ScopedSysColorChangeListener> color_change_listener_;
#endif
};
}  
}  
#endif