Fixed NPE when something goes wrong with a dataset selection