Well, I don't think this will solve the nullpointer (could you post the stacktrace?), but here are two things that definately are needed:
1. In the GUI class where you send the packet, you're using "PacketDispatcher.sendPacketToAllPlayers()". However, this method is used to send data from the server to all the clients (players). You obviously need the opposite. Use "PacketDispatcher.sendPacketToServer()" instead.
2. Do you have your PacketHandler registered? Make sure you have the @NetworkMod annotation on top of your main mod class (under or above the @Mod annotation). This should work:
@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {PacketBase.CHANNEL}, packetHandler = PacketHandler.class)