bugfix for NPE on save pdf issue