Skip to content

Commit 1266353

Browse files
committed
alias_resolve: skip over empty alias rows
1 parent 60be4c3 commit 1266353

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mda/alias_resolve.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static std::shared_ptr<alias_map> xa_refresh_aliases(MYSQL *conn) try
103103
DB_RESULT res = mysql_store_result(conn);
104104
DB_ROW row;
105105
while ((row = res.fetch_row()) != nullptr)
106-
if (row[0] != nullptr && row[1] != nullptr)
106+
if (row[0] != nullptr && *row[0] != '\0' && row[1] != nullptr && *row[1] != '\0')
107107
newmap.emplace(row[0], row[1]);
108108
auto n_aliases = newmap.size();
109109

@@ -118,7 +118,7 @@ static std::shared_ptr<alias_map> xa_refresh_aliases(MYSQL *conn) try
118118
return nullptr;
119119
res = mysql_store_result(conn);
120120
while ((row = res.fetch_row()) != nullptr)
121-
if (row[0] != nullptr && row[1] != nullptr)
121+
if (row[0] != nullptr && *row[0] != '\0' && row[1] != nullptr && *row[1] != '\0')
122122
newmap.emplace(row[0], row[1]);
123123
auto n_contacts = newmap.size() - n_aliases;
124124
mlog(LV_INFO, "I-1612: refreshed alias_resolve map with %zu aliases and %zu contact objects",

0 commit comments

Comments
 (0)