Hey,
FIX IT, when there're 0 players at server, and some loop with "Client" ent runned, it says error or server crashes,
Error is:
Object reference not set to an instance of an object ( Google translate ftw ).
Maybe with "Please" ?
And now you will insult me on Steam
if(client == null) return;
(07-16-2012, 19:06)Pozzuh Wrote: [ -> ]if(client == null) return;
i did it,
but anyways, it there way to make something like gscs?
I used to do if(GetClients() == null)
It's like 1 line extra to your code and it's kinda easy to check.
So @
zxz0O0 feel free to ignore this thread.
(07-16-2012, 19:59)JariZ Wrote: [ -> ]I used to do if(GetClients() == null)
It's like 1 line extra to your code and it's kinda easy to check.
So @zxz0O0 feel free to ignore this thread.
He would ignore it anyway since he is on a 3 week vacation ^^ goodluck with the complaints
When I read the title I thought about:
Ontopic: not really hard to implement a small fix in each plugin.
GetClients should still be returning an empty List<ServerClient> instead of a null object. @
zxz0O0
(07-17-2012, 17:39)master131 Wrote: [ -> ]GetClients should still be returning an empty List<ServerClient> instead of a null object. @zxz0O0
The function is checking if the server is running, if not it returns NULL. This is how @
Nukem coded it and I am ok with that. You can, as @
JariZ said, just check the List for NULL or use check if the dvar sv_running is 0.