Check the file handle for NULL before using it to write. Under some circumstances this might be NULL if we opened the file after initialization and it failed. In this case, we should just silently fail rather than throwing an invalid parameter exception.
Check the file handle for NULL before using it to write. Under some
circumstances this might be NULL if we opened the file after initialization and
it failed. In this case, we should just silently fail rather than throwing
an invalid parameter exception.

I'm not 100% sure this will fix the bug below, I did this by inspection.

BUG=7566
Review URL: http://codereview.chromium.org/21425

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@9917 0039d316-1c4b-4281-b951-d872f2087c98

dushu1203/chromium.src,axinging/chromium-crosswalk,robclark/chromium,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,robclark/chromium,patrickm/chromium.src,timopulkkinen/BubbleFish,dushu1203/chromium.src,Jonekee/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,hujiajie/pa-chromium,zcbenz/cefode-chromium,rogerwang/chromium,crosswalk-project/chromium-crosswalk-efl,robclark/chromium,Jonekee/chromium.src,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,rogerwang/chromium,nacl-webkit/chrome_deps,keishi/chromium,Just-D/chromium-1,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,rogerwang/chromium,Jonekee/chromium.src,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,chuan9/chromium-crosswalk,robclark/chromium,jaruba/chromium.src,mogoweb/chromium-crosswalk,robclark/chromium,dednal/chromium.src,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,ltilve/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,axinging/chromium-crosswalk,robclark/chromium,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,robclark/chromium,dushu1203/chromium.src,keishi/chromium,markYoungH/chromium.src,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,Just-D/chromium-1,rogerwang/chromium,rogerwang/chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,keishi/chromium,rogerwang/chromium,patrickm/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,Jonekee/chromium.src,Chilledheart/chromium,zcbenz/cefode-chromium,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,markYoungH/chromium.src,fujunwei/chromium-crosswalk,rogerwang/chromium,ltilve/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,anirudhSK/chromium,dushu1203/chromium.src,rogerwang/chromium,keishi/chromium,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,ondra-novak/chromium.src,ltilve/chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,robclark/chromium,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,Jonekee/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk,jaruba/chromium.src,littlstar/chromium.src,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,keishi/chromium,mogoweb/chromium-crosswalk,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,Just-D/chromium-1,timopulkkinen/BubbleFish,patrickm/chromium.src,keishi/chromium,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,rogerwang/chromium,dushu1203/chromium.src,Jonekee/chromium.src,littlstar/chromium.src,anirudhSK/chromium,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,jaruba/chromium.src,jaruba/chromium.src,Chilledheart/chromium,littlstar/chromium.src,zcbenz/cefode-chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,keishi/chromium,littlstar/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,ltilve/chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,robclark/chromium,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,ltilve/chromium,dednal/chromium.src,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,jaruba/chromium.src,timopulkkinen/BubbleFish,rogerwang/chromium,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,nacl-webkit/chrome_deps,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,Chilledheart/chromium,mogoweb/chromium-crosswalk,keishi/chromium,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,ondra-novak/chromium.src,hujiajie/pa-chromium,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,patrickm/chromium.src,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,jaruba/chromium.src,anirudhSK/chromium,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,littlstar/chromium.src,nacl-webkit/chrome_deps,hujiajie/pa-chromium,littlstar/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,anirudhSK/chromium,dednal/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,dednal/chromium.src,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,ChromiumWebApps/chromium,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,keishi/chromium,robclark/chromium,nacl-webkit/chrome_deps,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,timopulkkinen/BubbleFish,dushu1203/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,ChromiumWebApps/chromium,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,M4sse/chromium.src,bright-sparks/chromium-spacewalk