sample/report_env_es.rb : Added NULL check for window handle.