Skip to content

Commit

Permalink
fix failed assertion when sld import fails
Browse files Browse the repository at this point in the history
  • Loading branch information
brushtyler committed Sep 28, 2012
1 parent 84625ee commit ada8d40
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,28 +304,28 @@ QgsFeatureRendererV2* QgsSingleSymbolRendererV2::createFromSld( QDomElement& ele
childElem = childElem.nextSiblingElement();
}

if ( layers.size() == 0 )
return NULL;

// now create the symbol
QgsSymbolV2 *symbol = 0;
if ( layers.size() > 0 )
QgsSymbolV2 *symbol;
switch ( geomType )
{
switch ( geomType )
{
case QGis::Line:
symbol = new QgsLineSymbolV2( layers );
break;
case QGis::Line:
symbol = new QgsLineSymbolV2( layers );
break;

case QGis::Polygon:
symbol = new QgsFillSymbolV2( layers );
break;
case QGis::Polygon:
symbol = new QgsFillSymbolV2( layers );
break;

case QGis::Point:
symbol = new QgsMarkerSymbolV2( layers );
break;
case QGis::Point:
symbol = new QgsMarkerSymbolV2( layers );
break;

default:
QgsDebugMsg( QString( "invalid geometry type: found %1" ).arg( geomType ) );
return NULL;
}
default:
QgsDebugMsg( QString( "invalid geometry type: found %1" ).arg( geomType ) );
return NULL;
}

// and finally return the new renderer
Expand Down

0 comments on commit ada8d40

Please sign in to comment.