From 237065fc869d3a4ca581f32fdcebcab42faec8c1 Mon Sep 17 00:00:00 2001 From: gsherman Date: Sun, 24 Nov 2002 00:20:00 +0000 Subject: [PATCH] fix segfault when no layers on map and table button clicked git-svn-id: http://svn.osgeo.org/qgis/trunk@149 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/qgisapp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qgisapp.cpp b/src/qgisapp.cpp index 1e6aa7dafa1..fea620e77e7 100644 --- a/src/qgisapp.cpp +++ b/src/qgisapp.cpp @@ -61,7 +61,7 @@ #include // version -static const char *qgisVersion = "0.0.6-alpha-dev"; +static const char *qgisVersion = "0.0.6"; // cursors static unsigned char zoom_in_bits[] = { 0xf8, 0x00, 0x06, 0x03, 0x22, 0x02, 0x21, 0x04, 0x21, 0x04, 0xfd, 0x05, @@ -365,6 +365,7 @@ void QgisApp::identify() void QgisApp::attributeTable() { QListViewItem *li = legendView->currentItem(); + if(li){ QgsMapLayer *lyr = ((QgsLegendItem *) li)->layer(); if (lyr) { lyr->table(); @@ -372,6 +373,7 @@ void QgisApp::attributeTable() } else { QMessageBox::information(this, "No Layer Selected", "To open an attribute table, you must select a layer in the legend"); } + } } //void QgisApp::readWKB (const char *connInfo, QStringList tables)