ItsMods

Full Version: FIX IT
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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" ? Smile


And now you will insult me on Steam Troll
(07-16-2012, 18:21)Romuald27 Wrote: [ -> ]Maybe with "Please" ? Smile


And now you will insult me on Steam Troll

Maybe you will shut up? Smile


And now you will spam here Troll
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 Troll
When I read the title I thought about:

[Image: SimonizFixItproPen1__64229_zoom.jpg]

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.