[Qgis-developer] QgsRendererRangeV2.symbol() dumps QGIS

Tom Chadwin tom.chadwin at nnpa.org.uk
Mon Mar 14 05:08:03 PDT 2016

I'm not sure how, but that line is no longer crashing. However, I am now
getting a crash on a subsequent line:

wallColor = symbol.symbolLayer(1).subSymbol().color().name()

What is interesting is that it crashes not immediately, but on the third
feature it loops to in "for feat in feats". Simplified code snippet:

for feat in feats:
    classAttribute = renderer.classAttribute()
    attrValue = feat.attribute(classAttribute)
    ranges = renderer.ranges()
    for range in ranges:
        if (attrValue >= range.lowerValue() and attrValue <=
            symbol = range.symbol()
    wallColor = symbol.symbolLayer(1).subSymbol().color().name()

What could cause that last line to crash for some features but not others?

View this message in context: http://osgeo-org.1560.x6.nabble.com/QgsRendererRangeV2-symbol-dumps-QGIS-tp5255977p5256206.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.

More information about the Qgis-developer mailing list