Skip to content

Commit 8d9c2df

Browse files
committed
refactor: 增加参数检查
1 parent 678ee72 commit 8d9c2df

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/BootstrapBlazor/wwwroot/modules/utility.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,11 @@ export function registerBootstrapBlazorModule(name, identifier, callback) {
824824
return this;
825825
},
826826
dispose: function (identifier, callback) {
827-
const index = this._items.indexOf(identifier);
828-
if (index > -1) {
829-
this._items.splice(index, 1);
827+
if (identifier) {
828+
const index = this._items.indexOf(identifier);
829+
if (index > -1) {
830+
this._items.splice(index, 1);
831+
}
830832
}
831833
if (this._items.length === 0) {
832834
callback();

0 commit comments

Comments
 (0)