geostyler / geostyler-sld-parser

GeoStyler-Style-Parser implementation for SLD
BSD 2-Clause "Simplified" License
52 stars 33 forks source link

Parser breaks when using an `PropertyIsNull` Filter #10

Closed weskamm closed 6 years ago

weskamm commented 6 years ago

The parser currently breaks when feeding with an PropertyIsNull filter, as the following line https://github.com/terrestris/geostyler-sld-parser/blob/c2ac49b2a74a3876d3a2020a596939bef54153f9/src/SldStyleParser.ts#L156 tries to read a literal which does not exist in this case.

Should be fixed just by using

let value = null;
if (sldOperatorName !== 'PropertyIsNull') {
  value = sldFilter.Literal[0];
}
KaiVolland commented 6 years ago

Thanks for the issue and the fix allready.