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

Funded by ItOpen - http://www.itopen.it
Merge pull request #1667 from elpaso/bugfix11510

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