BUG: fix NULL dereference on longdouble conversion error

Closes gh-627