Made check for customcode option more robust

Prevents PHP notice when key is not set in array.