Fixed NullPointerException when random data is sent via the network socket