LUN-1260: small improvement in javascript for null/undefined verification