Fix for coverity (may pass NULL char pointer to strstr)