blenderlab / BattleIA

Client/Server app for Adimaker IT curses
2 stars 19 forks source link

Object reference not set to an instance of an object #43

Closed rfleuryleveso closed 3 years ago

rfleuryleveso commented 3 years ago

Describe the bug When starting the server and connecting a bot. The server crashes after a few milliseconds with this error: System.NullReferenceException : 'Object reference not set to an instance of an object.'

5__4.bot.k__BackingField a été null. ![image](https://user-images.githubusercontent.com/56384490/100554350-68384980-3294-11eb-9ca2-a504f64e7908.png) **To Reproduce** Steps to reproduce the behavior: 1. Clone the project. 2. Start a server 3. Connect a websocket client 4. Connect a bot 5. Crash. **Expected behavior** Transmit datas without crash.
blenderlab commented 3 years ago

The Bot Name seems to be null. With an empty name in the bot's settings, the bot dies when it send its name ("").

One solution should be to create a random name in case of empty on the bot side.