added null check for currentobject in getPosition in Collision class