Exception in thread "Thread-0" java.lang.NullPointerException at func_server_install.send_global_message(func_server_install.java:41) at func_server_char.run(func_server_install.java:80)// Code as follow: public static void send_global_message(String message, int expect) { // For everyone for(int i=0; i <= count;i++) { try { if(i == expect) continue; PrintWriter out = new PrintWriter(yeah.players.get(i).getOutputStream(), true); out.println(message);System.out.println("YOYOYOYO"); out.close(); } catch(java.io.IOException e) { System.out.println("Couldnt send it to "+message); } } }}