From e49661d7e0f71c64102ef53e03aebfbf17a489ec Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 12 Jul 2016 19:27:31 +0200 Subject: [PATCH] [server] Fix crash in WMS server when... bad things happen No idea what exactly the reason is, and it was only discovered by countless hours of printf-debugging. So I'm just pushing the fix for everyone else who might be affected. --- src/server/qgswmsprojectparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/qgswmsprojectparser.cpp b/src/server/qgswmsprojectparser.cpp index e2c06d75126..4448aada80c 100644 --- a/src/server/qgswmsprojectparser.cpp +++ b/src/server/qgswmsprojectparser.cpp @@ -1146,6 +1146,11 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc, } } + if ( !ltGroup ) + { + QgsDebugMsg( QString( "Skipping group %1, it could not be found" ).arg( name ) ); + continue; + } QString shortName = ltGroup->customProperty( "wmsShortName" ).toString(); QString title = ltGroup->customProperty( "wmsTitle" ).toString();