From caf334e65b11f9ee1590f74fe395e97d92bbe699 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 4 Feb 2020 11:04:58 +1000 Subject: [PATCH] Fix crash when changing raster data source Fixes #34231 --- src/app/qgisapp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 2aeace21691c..f80993ffb658 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -7716,7 +7716,7 @@ void QgisApp::changeDataSource( QgsMapLayer *layer ) { subsetString = vlayer->dataProvider()->subsetString(); } - if ( subsetString.isEmpty() ) + if ( vlayer && subsetString.isEmpty() ) { // actually -- the above isn't true in all situations. If a layer was invalid at the time // that the subset string was set, then ONLY the layer has knowledge of this subset string!