From 295ca86ac1f28414186d6785713d8fa7c283f519 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 16 Mar 2015 02:43:02 +0100 Subject: [PATCH] OpenCS FileDialog crash fix The file dialog would crash when no game file is selected and an addon file with no dependency is checked, then unchecked. --- apps/opencs/view/doc/filedialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/doc/filedialog.cpp b/apps/opencs/view/doc/filedialog.cpp index 8dd83f24a..1b3196112 100644 --- a/apps/opencs/view/doc/filedialog.cpp +++ b/apps/opencs/view/doc/filedialog.cpp @@ -153,11 +153,13 @@ void CSVDoc::FileDialog::slotUpdateAcceptButton(const QString &name, bool) if (isNew) success = success && !(name.isEmpty()); - else + else if (success) { ContentSelectorModel::EsmFile *file = mSelector->selectedFiles().back(); mAdjusterWidget->setName (file->filePath(), !file->isGameFile()); } + else + mAdjusterWidget->setName ("", true); ui.projectButtonBox->button (QDialogButtonBox::Ok)->setEnabled (success); }