FolderWizard: fix crash in FolderWizardRemotePath::slotHandleLsColNetworkError

The Job is a LsColJob, not a MkColJob!

Reproduce by entering a name with invalid character that cause an error 400
in the folder wizard's remote path line edit.

(Relates issue #5924)
This commit is contained in:
Olivier Goffart 2017-07-28 10:13:07 +02:00 committed by Markus Goetz
parent 7a96e8a292
commit f707a43b3c

View file

@ -22,6 +22,7 @@
#include "accountstate.h" #include "accountstate.h"
#include "creds/abstractcredentials.h" #include "creds/abstractcredentials.h"
#include "wizard/owncloudwizard.h" #include "wizard/owncloudwizard.h"
#include "asserts.h"
#include <QDesktopServices> #include <QDesktopServices>
#include <QDir> #include <QDir>
@ -229,7 +230,8 @@ void FolderWizardRemotePath::slotHandleMkdirNetworkError(QNetworkReply *reply)
void FolderWizardRemotePath::slotHandleLsColNetworkError(QNetworkReply * /*reply*/) void FolderWizardRemotePath::slotHandleLsColNetworkError(QNetworkReply * /*reply*/)
{ {
auto job = qobject_cast<MkColJob *>(sender()); auto job = qobject_cast<LsColJob *>(sender());
ASSERT(job);
showWarn(tr("Failed to list a folder. Error: %1") showWarn(tr("Failed to list a folder. Error: %1")
.arg(job->errorStringParsingBody())); .arg(job->errorStringParsingBody()));
} }