From: Marcus Eggenberger Date: Thu, 12 Mar 2009 12:00:57 +0000 (+0100) Subject: Treating invalid IdentityIds as NULL values X-Git-Tag: 0.5-rc1~307 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=c53377c152225754948165f082fe2062a5403dd1;hp=fbea3b379a5e2a21b343037ac96d106ad1fe5c63 Treating invalid IdentityIds as NULL values --- diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp index 143adbb9..d65b4ee0 100644 --- a/src/core/postgresqlstorage.cpp +++ b/src/core/postgresqlstorage.cpp @@ -546,7 +546,7 @@ NetworkId PostgreSqlStorage::createNetwork(UserId user, const NetworkInfo &info) void PostgreSqlStorage::bindNetworkInfo(QSqlQuery &query, const NetworkInfo &info) { query.bindValue(":networkname", info.networkName); - query.bindValue(":identityid", info.identity.toInt()); + query.bindValue(":identityid", info.identity.isValid() ? info.identity.toInt() : QVariant()); query.bindValue(":encodingcodec", QString(info.codecForEncoding)); query.bindValue(":decodingcodec", QString(info.codecForDecoding)); query.bindValue(":servercodec", QString(info.codecForServer));