Fix crash when a pin corresponds to a deleted document