nullpointer bugfix (another repaint racecondition)