We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 6fd2183 commit 4cb0b8aCopy full SHA for 4cb0b8a
src/gui/qgsmapcanvas.cpp
@@ -175,8 +175,11 @@ QgsMapRender* QgsMapCanvas::mapRender()
175
176
QgsMapLayer* QgsMapCanvas::getZpos(int index)
177
{
178
- QString layer = mMapRender->layerSet()[index];
179
- return QgsMapLayerRegistry::instance()->mapLayer(layer);
+ std::deque<QString>& layers = mMapRender->layerSet();
+ if (index >= 0 && index < (int) layers.size())
180
+ return QgsMapLayerRegistry::instance()->mapLayer(layers[index]);
181
+ else
182
+ return NULL;
183
}
184
185
0 commit comments