Lookup and if statement issue.

Lookup and if statement issue.

I have an On User Input script that is checking the contents of a lookup. Depending on the choice, I want to show a new field. The dropdown lookup has device categories, tablet, smartphone etc, upon the choice of smartphone I want a new field to pop up where they can put what the device is.

  1. if (input.Device_Categories.Device_Category  ==  "Mobile Phone/Smartphone")
  2. {
  3.     show Mobile_or_Tablet_Type;
  4. }

I keep getting the following error:
Improper Statements/Expressions found 

java.lang.NullPointerException

I figure this is because the lookup is maybe wanting to match an ID rather then the Device_Category name, I have forced this to work for now by doing:

  1. if (input.Device_Categories  ==  114232000012128039)
  2. {
  3.     show Mobile_or_Tablet_Type;
  4. }

But this is a bit counter intuitive...