Used correct drawing method. Added test for null graphics