fix to nullpointer exception

This is a fix to an unusual NullPointerException that occurs during drag and drop