SSH: Don't call FileReader::fetch() with empty file name.

Harmless, but triggers a warning in Qt.

Change-Id: I8d86a5bf28a66e47a680d9dd277c4c85b1a8f63f
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Christian Kandeler
2011-11-22 17:48:54 +01:00
parent 912f1f60c4
commit c43415e4ea

View File

@@ -454,6 +454,8 @@ void SshConnectionPrivate::handleServiceAcceptPacket()
SshCapabilities::SshConnectionService, m_connParams.password.toUtf8()); SshCapabilities::SshConnectionService, m_connParams.password.toUtf8());
} else { } else {
Utils::FileReader reader; Utils::FileReader reader;
if (m_connParams.privateKeyFile.isEmpty())
throw SshClientException(SshKeyFileError, tr("No private key file given."));
if (!reader.fetch(m_connParams.privateKeyFile)) if (!reader.fetch(m_connParams.privateKeyFile))
throw SshClientException(SshKeyFileError, throw SshClientException(SshKeyFileError,
tr("Private key error: %1").arg(reader.errorString())); tr("Private key error: %1").arg(reader.errorString()));