9 Replies Latest reply on May 23, 2017 3:34 AM by qngo RSS
    mbereket Apprentice

    How to handle java null pointer exceptions

    Hey There,

     

    I was working on this very simple service that I wrote for ThingShapes.

     

    All I am doing is "Updating a Thing's Property". However, I keep getting java.lang.NullPointerException Cause: Null,

     

    my Service on the Thing is following:

     

    if(Contact){

    Things[uuid].Contact = Contact;

    }

    if(Contact_Phone){

    Things[uuid].Contact_Phone = Contact_Phone;

    }

    if(MyName){

    Things[uuid].MyName = MyName;

    }

    if(phyLocation){

    Things[uuid].phyLocation = phyLocation;

    }

    if(freq){

    Things[uuid].freq = freq;

    }

     

    I am not sure what I am doing wrong.