[BUGFIX] Prevent call of updateReferenceIndex on unknown object

Fixes: #46418
Releases: 6.1, 6.0

Change-Id: I20ab919c2290edcf6478f8edc7a0eafe2bac7cbb
Reviewed-on: https://review.typo3.org/19032
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Frans Saris
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs