do not crash nastily on invalid input
Authored by: thibautd 2014-05-02
Parent: [r28824]
Child: [r28826]