fix to nullpointer exception

This is a fix to an unusual NullPointerException that occurs during drag and drop
Merge remote-tracking branch 'origin/patch-1'