NXP-15764: fix possible NPE on indexing