This fixes an issue that was seen in https://github.com/spacetelescope/jdaviz/pull/2529 which is that if we change the dataset used for the x attribute for the histogram, this failed if the original dataset was removed from the data collection or if the new dataset was not linked to the original one.
This fixes an issue that was seen in https://github.com/spacetelescope/jdaviz/pull/2529 which is that if we change the dataset used for the x attribute for the histogram, this failed if the original dataset was removed from the data collection or if the new dataset was not linked to the original one.