Cannot bind undefined
to safe resource URL property
#42527
Labels
area: core
Issues related to the framework runtime
core: sanitization
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Milestone
Bug Report
Affected Package
The issue is eventually caused by this code:
angular/packages/core/src/sanitization/sanitization.ts
Lines 111 to 121 in 3de774e
Is this a regression?
Probably not. However, Angular 11 compiled to ES5 (old-style config for legacy browsers, without differential loading) behaves differently.
Description
This template HTML compiles on strict mode:
It will, however, throw an exception at runtime or in tests at
fixture.detectChanges();
.I believe
undefined
is not an unsafe value. However, it probably should not be tested with the sanitizer in the first place.Minimal Reproduction
https://github.com/fuzzykiller/ng-sanitizer-problem
Run
npm i
andng test
to see error.Exception or Error
Your Environment
Angular Version:
Anything else relevant?
Not that I can think of.
The text was updated successfully, but these errors were encountered: