Octops / agones-event-broadcaster

Broadcast Agones GameServers and Fleets states to the external world
https://octops.io
Apache License 2.0
25 stars 6 forks source link

Return if Manager is nil to avoid panic #25

Closed danieloliveira079 closed 2 years ago

danieloliveira079 commented 2 years ago

Fix missing Error check.

If the broadcaster object has already an error, the WithWatcherFor should return the present object and do not proceed.

Bellow is a possible error that must prevent the watcher to be created. It means there was another error while creating the manager.

{"error":"can't build a broadcaster without controllers, use WithController method to add a controller: broadcaster requires a manager to operate: error creating manager: manager could not be created: error listening on :9090: listen tcp :9090: bind: address already in use","message":"error creating broadcaster","severity":"fatal","time":"2022-05-21T17:56:45.762275+02:00"}