NXP-12822: avoid NPE when removing attached file