fix #685: check for null value