Skip to content

Commit 92ecf38

Browse files
authored
[FIX] Issue in pc.ScriptRegistry#has preventing npm build:all (playcanvas#1987)
1 parent d8f478e commit 92ecf38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/script/script-registry.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ Object.assign(pc, function () {
203203
return this._scripts.hasOwnProperty(nameOrType);
204204
}
205205

206-
var scriptName = scriptType.__name;
207-
return this._scripts[scriptName] == scriptType;
206+
if (!nameOrType) return false;
207+
var scriptName = nameOrType.__name;
208+
return this._scripts[scriptName] === nameOrType;
208209
};
209210

210211
/* eslint-disable jsdoc/no-undefined-types */

0 commit comments

Comments
 (0)