Returns NULL when a geometry is NULL instead of calling ST_AsText with a null value. Thanks to Dominique Legendre for the report.