fix(ivy): fix invalid provider error messages under TestBed (#28033)
fix(ivy): fix invalid provider error messages under TestBed (#28033)

An @NgModule with invalid provider declarations produces errors under
normal circumstances. However, within the TestBed two small issues with
provider overrides interfered with the correct production of these errors:

1. a 'null' provider object caused a premature crash when the TestBed
   attempted to check for a 'provide' property on it with hasOwnProperty().
2. the array of providers would have an empty override array appended to it
   for each input provider, which would pollute the error messages produced
   down the line.

This commit fixes both of these issues, by 1) checking for null and 2)
filtering out the empty override arrays.

Testing strategy: future commits change the way the TestBed compiles
modules, causing tests to become sensitive to this bug if not fixed.

PR Close #28033

IdeaBlade/angular,IgorMinar/angular,hansl/angular,matsko/angular,mgechev/angular,StephenFluin/angular,mlaval/angular,gdi2290/angular,jasonaden/angular,shairez/angular,ultrasonicsoft/angular,Toxicable/angular,jasonaden/angular,gkalpak/angular,filipesilva/angular,sarunint/angular,IdeaBlade/angular,snaptech/angular,mprobst/angular,manekinekko/angular,filipesilva/angular,IgorMinar/angular,mprobst/angular,IgorMinar/angular,brandonroberts/angular,snaptech/angular,jasonaden/angular,mhevery/angular,vikerman/angular,sarunint/angular,alxhub/angular,wKoza/angular,shairez/angular,petebacondarwin/angular,petebacondarwin/angular,manekinekko/angular,jasonaden/angular,jasonaden/angular,IdeaBlade/angular,hansl/angular,juristr/angular,petebacondarwin/angular,gnomeontherun/angular,gnomeontherun/angular,mlaval/angular,StephenFluin/angular,hansl/angular,hansl/angular,juristr/angular,alexeagle/angular,mgechev/angular,shairez/angular,gkalpak/angular,angular-indonesia/angular,sarunint/angular,brandonroberts/angular,vikerman/angular,snaptech/angular,juristr/angular,StephenFluin/angular,StephenFluin/angular,shairez/angular,alxhub/angular,mlaval/angular,ultrasonicsoft/angular,mhevery/angular,alxhub/angular,alexeagle/angular,brandonroberts/angular,mhevery/angular,IdeaBlade/angular,jasonaden/angular,mprobst/angular,gkalpak/angular,ocombe/angular,vikerman/angular,hansl/angular,alxhub/angular,matsko/angular,alxhub/angular,IgorMinar/angular,Brocco/angular,juristr/angular,Toxicable/angular,snaptech/angular,gnomeontherun/angular,sarunint/angular,sarunint/angular,wKoza/angular,JiaLiPassion/angular,mgechev/angular,mprobst/angular,angular-indonesia/angular,petebacondarwin/angular,snaptech/angular,Brocco/angular,matsko/angular,wKoza/angular,Toxicable/angular,angular-indonesia/angular,Brocco/angular,Toxicable/angular,mhevery/angular,mhevery/angular,vikerman/angular,ocombe/angular,angular/angular,alexeagle/angular,ocombe/angular,gdi2290/angular,mlaval/angular,gkalpak/angular,gdi2290/angular,blesh/angular,alexeagle/angular,matsko/angular,gdi2290/angular,juristr/angular,StephenFluin/angular,gdi2290/angular,manekinekko/angular,JiaLiPassion/angular,angular-indonesia/angular,ocombe/angular,IdeaBlade/angular,blesh/angular,petebacondarwin/angular,petebacondarwin/angular,sarunint/angular,brandonroberts/angular,Brocco/angular,ocombe/angular,ultrasonicsoft/angular,JiaLiPassion/angular,mhevery/angular,mlaval/angular,shairez/angular,Brocco/angular,manekinekko/angular,vikerman/angular,IgorMinar/angular,IgorMinar/angular,ultrasonicsoft/angular,hansl/angular,manekinekko/angular,ocombe/angular,manekinekko/angular,mprobst/angular,wKoza/angular,alexeagle/angular,gnomeontherun/angular,JiaLiPassion/angular,ultrasonicsoft/angular,angular/angular,filipesilva/angular,wKoza/angular,blesh/angular,angular/angular,snaptech/angular,mgechev/angular,blesh/angular,mgechev/angular,alexeagle/angular,juristr/angular,mprobst/angular,ultrasonicsoft/angular,brandonroberts/angular,filipesilva/angular,gdi2290/angular,Toxicable/angular,angular/angular,filipesilva/angular,Toxicable/angular,matsko/angular,Brocco/angular,blesh/angular,brandonroberts/angular,vikerman/angular,wKoza/angular