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/qgis@5572 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 9, 2006
1 parent fd1eb1f commit b26ce47
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
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 b26ce47

Please sign in to comment.