Fix #11510 graduated renderer causes crash: added check for geometry needed

Funded by ItOpen - http://www.itopen.it