I have a little problem.
In the moment I want to send a message I have an error:
java.lang.NullPointerException
at application.Connection.send(Connection.java:29)
at application.Messages.lambda$1(Messages.java:151)
Some code:
sendBtn.setOnAction(t - > {
String gotowyTekst = poleDoWpisywania.getText();
poleDoWpisywania.clear();
try {
connection.send(gotowyTekst);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and
public void send(Serializable data) throws Exception {
cThread.out.writeObject(data);
}
How I do fix it?
I don't know where to look for a solution anymore.