fix possible crash with NULL string