NXP-13410: make invalidation of current document safer in case current doc is null