Fix in NullPointerException in Graphics.java