Null value in dataset

Good afternoon,

I have this code that works fine when there are no NULL values

sc_lookup(ds1,$ticketDetLookup);

{staffID}= {ds1}[0][2];
{ticketAssignStatus}= {ds1}[0][3];
{ticketStatus}= {ds1}[0][4];

however there will be times that the staffID may be NULL. Of course due to this I get Undefined offset: 0.
what is the best way to allow this value to remain null or empty in the system?

thanks

you can validate it:
if ({ds1}[0][2] == null) {

}