Skip to content

Commit 2cddedf

Browse files
author
wonder
committed
Fixed a crash (clicking zoom to layer with no active layer)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15588 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a35ef61 commit 2cddedf

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/app/legend/qgslegend.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,9 @@ void QgsLegend::legendLayerZoom()
17191719

17201720
QgsLegendItem* li = dynamic_cast<QgsLegendItem *>( currentItem() );
17211721

1722+
if ( !li )
1723+
return;
1724+
17221725
if ( li->type() == QgsLegendItem::LEGEND_LAYER )
17231726
{
17241727
QgsLegendLayer* currentLayer = dynamic_cast<QgsLegendLayer *>( currentItem() );

src/app/qgisapp.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -5790,11 +5790,13 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
57905790
mActionLocalHistogramStretch->setEnabled( false );
57915791
mActionFullHistogramStretch->setEnabled( false );
57925792
mActionZoomActualSize->setEnabled( false );
5793+
mActionZoomToLayer->setEnabled( false );
57935794
return;
57945795
}
57955796

57965797
mActionLayerProperties->setEnabled( true );
57975798
mActionAddToOverview->setEnabled( true );
5799+
mActionZoomToLayer->setEnabled( true );
57985800

57995801
/***********Vector layers****************/
58005802
if ( layer->type() == QgsMapLayer::VectorLayer )

0 commit comments

Comments
 (0)