Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
[libcontacts] Do not attempt to resolve with empty match values
Browse files Browse the repository at this point in the history
Do not falsely match empty inputs to any invalid empty stored values.
  • Loading branch information
matthewvogt committed Apr 10, 2014
1 parent d4df427 commit b2bab14
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/seasidecache.cpp
Expand Up @@ -905,6 +905,9 @@ SeasideCache::CacheItem *SeasideCache::itemByPhoneNumber(const QString &number,

SeasideCache::CacheItem *SeasideCache::itemByEmailAddress(const QString &email, bool requireComplete)
{
if (email.trimmed().isEmpty())
return 0;

QHash<QString, quint32>::const_iterator it = instancePtr->m_emailAddressIds.find(email.toLower());
if (it != instancePtr->m_emailAddressIds.end())
return itemById(*it, requireComplete);
Expand All @@ -914,6 +917,9 @@ SeasideCache::CacheItem *SeasideCache::itemByEmailAddress(const QString &email,

SeasideCache::CacheItem *SeasideCache::itemByOnlineAccount(const QString &localUid, const QString &remoteUid, bool requireComplete)
{
if (localUid.trimmed().isEmpty() || remoteUid.trimmed().isEmpty())
return 0;

QPair<QString, QString> address = qMakePair(localUid, remoteUid.toLower());

QHash<QPair<QString, QString>, quint32>::const_iterator it = instancePtr->m_onlineAccountIds.find(address);
Expand Down

0 comments on commit b2bab14

Please sign in to comment.