From c43415e4ea6b52fa7d026ce076346ee2218eafef Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 22 Nov 2011 17:48:54 +0100 Subject: [PATCH] SSH: Don't call FileReader::fetch() with empty file name. Harmless, but triggers a warning in Qt. Change-Id: I8d86a5bf28a66e47a680d9dd277c4c85b1a8f63f Reviewed-by: Christian Kandeler --- src/libs/utils/ssh/sshconnection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/utils/ssh/sshconnection.cpp b/src/libs/utils/ssh/sshconnection.cpp index 647a3d26be4..4776b78e386 100644 --- a/src/libs/utils/ssh/sshconnection.cpp +++ b/src/libs/utils/ssh/sshconnection.cpp @@ -454,6 +454,8 @@ void SshConnectionPrivate::handleServiceAcceptPacket() SshCapabilities::SshConnectionService, m_connParams.password.toUtf8()); } else { Utils::FileReader reader; + if (m_connParams.privateKeyFile.isEmpty()) + throw SshClientException(SshKeyFileError, tr("No private key file given.")); if (!reader.fetch(m_connParams.privateKeyFile)) throw SshClientException(SshKeyFileError, tr("Private key error: %1").arg(reader.errorString()));