Fix NPE in drag/drop code