fix #9138

it does solve 9138 but not sure it's the best way.

http://hub.qgis.org/issues/9138