check for null before calling tofixed.

Signed-off-by: Chris Jones <chris@jonezy.org>