Handle nulls gracefully in the JavaTestRule when reporting errors.
Handle nulls gracefully in the JavaTestRule when reporting errors.

Summary:
It's possible for the rule to be null when trying to figure out whether the source under
test is a java library rule. Handle this without causing buck to blow up.

Test Plan: Visual inspection of the code.

Dominator008/buck,Heart2009/buck,vschs007/buck,dushmis/buck,grumpyjames/buck,Heart2009/buck,rhencke/buck,artiya4u/buck,sdwilsh/buck,dushmis/buck,facebook/buck,janicduplessis/buck,clonetwin26/buck,nguyentruongtho/buck,mikekap/buck,bocon13/buck,clonetwin26/buck,dsyang/buck,artiya4u/buck,marcinkwiatkowski/buck,vschs007/buck,neonichu/buck,brettwooldridge/buck,illicitonion/buck,ilya-klyuchnikov/buck,robbertvanginkel/buck,vine/buck,daedric/buck,mikekap/buck,OkBuilds/buck,mikekap/buck,darkforestzero/buck,zhan-xiong/buck,jackminicloud/buck,neonichu/buck,shybovycha/buck,sdwilsh/buck,nguyentruongtho/buck,liuyang-li/buck,clonetwin26/buck,LegNeato/buck,dsyang/buck,pwz3n0/buck,shs96c/buck,artiya4u/buck,shs96c/buck,k21/buck,Distrotech/buck,shs96c/buck,vschs007/buck,vschs007/buck,romanoid/buck,k21/buck,sdwilsh/buck,Addepar/buck,darkforestzero/buck,rowillia/buck,OkBuilds/buck,bocon13/buck,k21/buck,siddhartharay007/buck,brettwooldridge/buck,bocon13/buck,Addepar/buck,pwz3n0/buck,Distrotech/buck,liuyang-li/buck,k21/buck,JoelMarcey/buck,zhuxiaohao/buck,neonichu/buck,romanoid/buck,mnuessler/buck,brettwooldridge/buck,clonetwin26/buck,davido/buck,kageiit/buck,k21/buck,luiseduardohdbackup/buck,k21/buck,zpao/buck,artiya4u/buck,janicduplessis/buck,rmaz/buck,bocon13/buck,1yvT0s/buck,Learn-Android-app/buck,shs96c/buck,robbertvanginkel/buck,dushmis/buck,bocon13/buck,Learn-Android-app/buck,Dominator008/buck,1yvT0s/buck,sdwilsh/buck,zhuxiaohao/buck,nguyentruongtho/buck,nguyentruongtho/buck,MarkRunWu/buck,stuhood/buck,robbertvanginkel/buck,tgummerer/buck,illicitonion/buck,brettwooldridge/buck,clonetwin26/buck,Heart2009/buck,rmaz/buck,siddhartharay007/buck,Distrotech/buck,illicitonion/buck,pwz3n0/buck,Heart2009/buck,zhuxiaohao/buck,davido/buck,sdwilsh/buck,sdwilsh/buck,grumpyjames/buck,marcinkwiatkowski/buck,davido/buck,shybovycha/buck,LegNeato/buck,davido/buck,liuyang-li/buck,pwz3n0/buck,robbertvanginkel/buck,neonichu/buck,liuyang-li/buck,dsyang/buck,vschs007/buck,thinkernel/buck,luiseduardohdbackup/buck,mogers/buck,vine/buck,raviagarwal7/buck,brettwooldridge/buck,tgummerer/buck,raviagarwal7/buck,clonetwin26/buck,grumpyjames/buck,Distrotech/buck,janicduplessis/buck,vschs007/buck,Dominator008/buck,illicitonion/buck,shybovycha/buck,janicduplessis/buck,grumpyjames/buck,robbertvanginkel/buck,vschs007/buck,ilya-klyuchnikov/buck,Distrotech/buck,MarkRunWu/buck,luiseduardohdbackup/buck,stuhood/buck,SeleniumHQ/buck,davido/buck,hgl888/buck,justinmuller/buck,k21/buck,1yvT0s/buck,brettwooldridge/buck,neonichu/buck,Addepar/buck,clonetwin26/buck,hgl888/buck,raviagarwal7/buck,stuhood/buck,mnuessler/buck,rmaz/buck,vschs007/buck,ilya-klyuchnikov/buck,marcinkwiatkowski/buck,lukw00/buck,mnuessler/buck,sdwilsh/buck,rhencke/buck,shs96c/buck,facebook/buck,lukw00/buck,luiseduardohdbackup/buck,shs96c/buck,grumpyjames/buck,darkforestzero/buck,raviagarwal7/buck,liuyang-li/buck,romanoid/buck,zhan-xiong/buck,SeleniumHQ/buck,grumpyjames/buck,belomx/open_tools,brettwooldridge/buck,dushmis/buck,janicduplessis/buck,vine/buck,mread/buck,LegNeato/buck,shs96c/buck,hgl888/buck,mikekap/buck,luiseduardohdbackup/buck,brettwooldridge/buck,shs96c/buck,k21/buck,bocon13/buck,sdwilsh/buck,lukw00/buck,brettwooldridge/buck,darkforestzero/buck,siddhartharay007/buck,illicitonion/buck,lukw00/buck,rhencke/buck,rowillia/buck,jackminicloud/buck,romanoid/buck,daedric/buck,siddhartharay007/buck,Dominator008/buck,artiya4u/buck,SeleniumHQ/buck,vine/buck,Addepar/buck,MarkRunWu/buck,SeleniumHQ/buck,janicduplessis/buck,luiseduardohdbackup/buck,shybovycha/buck,rowillia/buck,shybovycha/buck,Dominator008/buck,MarkRunWu/buck,justinmuller/buck,marcinkwiatkowski/buck,tgummerer/buck,dpursehouse/buck,mnuessler/buck,brettwooldridge/buck,SeleniumHQ/buck,davido/buck,robbertvanginkel/buck,mogers/buck,GerritCodeReview/buck,rhencke/buck,GerritCodeReview/buck,JoelMarcey/buck,Learn-Android-app/buck,dpursehouse/buck,dpursehouse/buck,artiya4u/buck,stuhood/buck,OkBuilds/buck,GerritCodeReview/buck,1yvT0s/buck,zhuxiaohao/buck,zhan-xiong/buck,marcinkwiatkowski/buck,zpao/buck,dsyang/buck,luiseduardohdbackup/buck,darkforestzero/buck,SeleniumHQ/buck,clonetwin26/buck,davido/buck,LegNeato/buck,vine/buck,rowillia/buck,Learn-Android-app/buck,romanoid/buck,raviagarwal7/buck,stuhood/buck,mogers/buck,artiya4u/buck,raviagarwal7/buck,ilya-klyuchnikov/buck,zhan-xiong/buck,LegNeato/buck,ilya-klyuchnikov/buck,mogers/buck,daedric/buck,justinmuller/buck,mnuessler/buck,zhuxiaohao/buck,tgummerer/buck,daedric/buck,davido/buck,davido/buck,clonetwin26/buck,luiseduardohdbackup/buck,grumpyjames/buck,Heart2009/buck,romanoid/buck,mikekap/buck,davido/buck,rmaz/buck,JoelMarcey/buck,janicduplessis/buck,vschs007/buck,dsyang/buck,JoelMarcey/buck,Dominator008/buck,k21/buck,saleeh93/buck-cutom,shybovycha/buck,Distrotech/buck,grumpyjames/buck,Addepar/buck,rowillia/buck,GerritCodeReview/buck,Dominator008/buck,rmaz/buck,LegNeato/buck,kageiit/buck,pwz3n0/buck,nguyentruongtho/buck,liuyang-li/buck,justinmuller/buck,neonichu/buck,artiya4u/buck,dpursehouse/buck,artiya4u/buck,Learn-Android-app/buck,siddhartharay007/buck,mread/buck,rowillia/buck,LegNeato/buck,Dominator008/buck,tgummerer/buck,ilya-klyuchnikov/buck,dsyang/buck,mogers/buck,dpursehouse/buck,Dominator008/buck,MarkRunWu/buck,OkBuilds/buck,hgl888/buck,JoelMarcey/buck,daedric/buck,justinmuller/buck,pwz3n0/buck,raviagarwal7/buck,robbertvanginkel/buck,brettwooldridge/buck,grumpyjames/buck,OkBuilds/buck,shybovycha/buck,neonichu/buck,saleeh93/buck-cutom,Distrotech/buck,Heart2009/buck,SeleniumHQ/buck,hgl888/buck,grumpyjames/buck,facebook/buck,Addepar/buck,stuhood/buck,darkforestzero/buck,justinmuller/buck,justinmuller/buck,1yvT0s/buck,neonichu/buck,robbertvanginkel/buck,hgl888/buck,1yvT0s/buck,Addepar/buck,illicitonion/buck,darkforestzero/buck,dushmis/buck,kageiit/buck,MarkRunWu/buck,shybovycha/buck,janicduplessis/buck,luiseduardohdbackup/buck,dsyang/buck,Learn-Android-app/buck,saleeh93/buck-cutom,tgummerer/buck,vschs007/buck,rhencke/buck,bocon13/buck,darkforestzero/buck,rmaz/buck,robbertvanginkel/buck,dushmis/buck,jackminicloud/buck,ilya-klyuchnikov/buck,janicduplessis/buck,clonetwin26/buck,SeleniumHQ/buck,facebook/buck,zpao/buck,romanoid/buck,mogers/buck,vine/buck,JoelMarcey/buck,siddhartharay007/buck,siddhartharay007/buck,lukw00/buck,thinkernel/buck,kageiit/buck,dsyang/buck,SeleniumHQ/buck,bocon13/buck,liuyang-li/buck,mread/buck,saleeh93/buck-cutom,LegNeato/buck,sdwilsh/buck,facebook/buck,vine/buck,darkforestzero/buck,k21/buck,mread/buck,rhencke/buck,lukw00/buck,JoelMarcey/buck,clonetwin26/buck,Addepar/buck,justinmuller/buck,shybovycha/buck,Learn-Android-app/buck,bocon13/buck,hgl888/buck,MarkRunWu/buck,dpursehouse/buck,ilya-klyuchnikov/buck,LegNeato/buck,justinmuller/buck,vschs007/buck,lukw00/buck,JoelMarcey/buck,liuyang-li/buck,ilya-klyuchnikov/buck,illicitonion/buck,zhan-xiong/buck,stuhood/buck,davido/buck,OkBuilds/buck,dushmis/buck,romanoid/buck,shs96c/buck,LegNeato/buck,vine/buck,grumpyjames/buck,janicduplessis/buck,dushmis/buck,rmaz/buck,mikekap/buck,rowillia/buck,zhuxiaohao/buck,romanoid/buck,justinmuller/buck,daedric/buck,illicitonion/buck,OkBuilds/buck,romanoid/buck,OkBuilds/buck,mogers/buck,zhuxiaohao/buck,bocon13/buck,neonichu/buck,daedric/buck,SeleniumHQ/buck,kageiit/buck,tgummerer/buck,SeleniumHQ/buck,rhencke/buck,mogers/buck,artiya4u/buck,romanoid/buck,sdwilsh/buck,robbertvanginkel/buck,rowillia/buck,davido/buck,raviagarwal7/buck,LegNeato/buck,MarkRunWu/buck,shybovycha/buck,rowillia/buck,rhencke/buck,saleeh93/buck-cutom,mnuessler/buck,mikekap/buck,mogers/buck,Addepar/buck,nguyentruongtho/buck,daedric/buck,daedric/buck,shs96c/buck,lukw00/buck,Heart2009/buck,rmaz/buck,dsyang/buck,shybovycha/buck,zpao/buck,illicitonion/buck,marcinkwiatkowski/buck,bocon13/buck,mikekap/buck,1yvT0s/buck,grumpyjames/buck,JoelMarcey/buck,pwz3n0/buck,LegNeato/buck,rmaz/buck,tgummerer/buck,romanoid/buck,Dominator008/buck,sdwilsh/buck,marcinkwiatkowski/buck,darkforestzero/buck,dushmis/buck,tgummerer/buck,zhuxiaohao/buck,Distrotech/buck,zhan-xiong/buck,Heart2009/buck,rhencke/buck,Addepar/buck,marcinkwiatkowski/buck,OkBuilds/buck,Learn-Android-app/buck,daedric/buck,shybovycha/buck,brettwooldridge/buck,rhencke/buck,rowillia/buck,belomx/open_tools,facebook/buck,kageiit/buck,mnuessler/buck,kageiit/buck,zhan-xiong/buck,zhan-xiong/buck,mnuessler/buck,zhan-xiong/buck,clonetwin26/buck,justinmuller/buck,dsyang/buck,liuyang-li/buck,liuyang-li/buck,zpao/buck,JoelMarcey/buck,Dominator008/buck,k21/buck,robbertvanginkel/buck,ilya-klyuchnikov/buck,zpao/buck,1yvT0s/buck,lukw00/buck,nguyentruongtho/buck,bocon13/buck,illicitonion/buck,justinmuller/buck,raviagarwal7/buck,mread/buck,vine/buck,raviagarwal7/buck,rmaz/buck,daedric/buck,davido/buck,k21/buck,raviagarwal7/buck,stuhood/buck,siddhartharay007/buck,romanoid/buck,OkBuilds/buck,marcinkwiatkowski/buck,zhan-xiong/buck,lukw00/buck,rmaz/buck,rowillia/buck,Heart2009/buck,mread/buck,zhan-xiong/buck,stuhood/buck,belomx/open_tools,k21/buck,illicitonion/buck,lukw00/buck,hgl888/buck,JoelMarcey/buck,shs96c/buck,ilya-klyuchnikov/buck,ilya-klyuchnikov/buck,pwz3n0/buck,Distrotech/buck,robbertvanginkel/buck,tgummerer/buck,JoelMarcey/buck,justinmuller/buck,mikekap/buck,Learn-Android-app/buck,illicitonion/buck,stuhood/buck,Learn-Android-app/buck,pwz3n0/buck,Addepar/buck,sdwilsh/buck,zhan-xiong/buck,rowillia/buck,shs96c/buck,raviagarwal7/buck,clonetwin26/buck,darkforestzero/buck,jackminicloud/buck,facebook/buck,tgummerer/buck,siddhartharay007/buck,brettwooldridge/buck,ilya-klyuchnikov/buck,liuyang-li/buck,OkBuilds/buck,thinkernel/buck,dsyang/buck,mogers/buck,Learn-Android-app/buck,janicduplessis/buck,vschs007/buck,mikekap/buck,rmaz/buck,dsyang/buck,artiya4u/buck,stuhood/buck,thinkernel/buck,vine/buck,mikekap/buck,1yvT0s/buck,Addepar/buck,Distrotech/buck,JoelMarcey/buck,marcinkwiatkowski/buck,pwz3n0/buck,rhencke/buck,dpursehouse/buck,robbertvanginkel/buck,OkBuilds/buck,OkBuilds/buck,marcinkwiatkowski/buck,SeleniumHQ/buck,Distrotech/buck,belomx/open_tools,darkforestzero/buck,marcinkwiatkowski/buck,mikekap/buck,dpursehouse/buck,LegNeato/buck,vschs007/buck,daedric/buck,illicitonion/buck,hgl888/buck,mogers/buck,sdwilsh/buck,zpao/buck,saleeh93/buck-cutom,darkforestzero/buck,Addepar/buck,SeleniumHQ/buck,Dominator008/buck,shs96c/buck,rmaz/buck,pwz3n0/buck,marcinkwiatkowski/buck,zhuxiaohao/buck,mnuessler/buck,raviagarwal7/buck,zhan-xiong/buck,daedric/buck,vine/buck,janicduplessis/buck,shybovycha/buck,dushmis/buck,dsyang/buck