NXP-13854: avoid NPE when manipulating placeless documents