NXP-11002: test for undefined to avoid error of type "can't read property of undefined"