Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not use optional chaining on a potentially undeclared root object
The global "OC" variable may be undefined depending on the initialization order, so optional chaining ("OC?.config" and "OC?.debug") was added to prevent accessing fields on an undefined variable. However, "OC" could be not only undefined, but also undeclared. Optional chaining can not be used on an undeclared root object, so it needs to be explicitly guarded against that to prevent a ReferenceError to be thrown. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
- Loading branch information