Make sure target index exists before setting target

The resize method can be invoked before a scene has a currentTargetIndex. Update guard in the setTarget method to also check whether a target exists.