Prevent a race condition when setting currentObject.