How to avoid NullPointerException?

Printable View