Fix NPE on export to text operation