0

I have this code:

booleans.put(varToSet, choiceResponse);

and it throws a NullPointerException. The error it shows is this:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at com.salsagames.prometheus.code.Compiler$2.either(Compiler.java:120)
    at com.salsagames.prometheus.code.message.YesNo.lambda$new$2(YesNo.java:73)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)

The two variables I use are:

varToSet test

choiceResponse true

I am using the right types for the Map, (String in, Boolean out).

My Map needed to be declared as new HashMap<>()

Luke Pasfield
  • 35
  • 2
  • 7

0 Answers0