scene_obj_find can return NULL but this is not checked for before the return is dereferenced. Add a NULL check. This issue was found by Smatch. Also add a NULL check for str. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>