Don't crash on errors.

Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>