Don't crash if smartplaylist wizard plugin is not found.

This commit is contained in:
Jim Broadus 2019-12-31 16:21:59 -08:00
parent 9f99cab314
commit 963b272c4b
1 changed files with 7 additions and 1 deletions

View File

@ -15,10 +15,11 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "core/logging.h"
#include "querywizardplugin.h"
#include "ui_wizardfinishpage.h"
#include "wizard.h"
#include "wizardplugin.h"
#include "ui_wizardfinishpage.h"
#include <QLabel>
#include <QRadioButton>
@ -106,6 +107,11 @@ void Wizard::SetGenerator(GeneratorPtr gen) {
finish_page_->ui_->name->setText(gen->name());
finish_page_->ui_->dynamic->setChecked(gen->is_dynamic());
if (type_index_ == -1) {
qLog(Error) << "Plugin was not found for generator type" << gen->type();
return;
}
// Tell the plugin to load
plugins_[type_index_]->SetGenerator(gen);
}