Skip to content

Commit

Permalink
Change an assert to an error message to avoid any future crashes like
Browse files Browse the repository at this point in the history
that in ticket #136


git-svn-id: http://svn.osgeo.org/qgis/trunk@5572 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 9, 2006
1 parent bca2e9c commit 1d4d637
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,14 @@ void QgsPostgresProvider::findColumns(tableCols& cols)
ii = columnRelations.find(QString(ii->second.table_schema + '.' +
ii->second.table_name + '.' +
ii->second.column_name));
assert(ii != columnRelations.end());
if (ii == columnRelations.end())
{
std::cerr << "ERROR: Failed to find the column that "
<< ii->second.table_schema.local8Bit().data() << '.'
<< ii->second.table_name.local8Bit().data() << "."
<< ii->second.column_name.local8Bit().data()
<< " refers to.\n";
}
++count;
}

Expand All @@ -1373,7 +1380,7 @@ void QgsPostgresProvider::findColumns(tableCols& cols)
<< "interation limit (" << max_loops << ").\n";
cols[ii->second.view_column_name] = SRC("","","","");
}
else
else if (ii != columnRelations.end())
{
cols[ii->second.view_column_name] =
SRC(ii->second.table_schema,
Expand Down

0 comments on commit 1d4d637

Please sign in to comment.