Fixed null error in plugin opts and added a test for it (#9945)
* Fixed null error in plugin opts and added a test for it * Remove !opts and add opts === null check to avoid confusion with false and undefined cases Co-Authored-By: divbhasin <divbest99@gmail.com>
This commit is contained in:
committed by
Nicolò Ribaudo
parent
354666aa17
commit
7942dc0f07
@@ -337,7 +337,7 @@ function assertPluginItem(loc: GeneralPath, value: mixed): PluginItem {
|
||||
if (
|
||||
opts !== undefined &&
|
||||
opts !== false &&
|
||||
(typeof opts !== "object" || Array.isArray(opts))
|
||||
(typeof opts !== "object" || Array.isArray(opts) || opts === null)
|
||||
) {
|
||||
throw new Error(
|
||||
`${msg(access(loc, 1))} must be an object, false, or undefined`,
|
||||
|
||||
Reference in New Issue
Block a user