Skip to content

Commit bd456a1

Browse files
committed
correct null case
1 parent f862736 commit bd456a1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Umbraco.Web.UI.Client/src/libs/class-api/class.mixin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export const UmbClassMixin = <T extends ClassConstructor<EventTarget>>(superClas
5959
// Fallback to use a hash of the provided method, but only if the alias is undefined and there is a callback.
6060
if (controllerAlias === undefined && callback) {
6161
controllerAlias = simpleHashCode(callback.toString());
62-
} else {
62+
} else if (controllerAlias === null) {
63+
// if value is null, then reset it to undefined. Null is used to explicitly tell that we do not want a controller alias. [NL]
6364
controllerAlias = undefined;
6465
}
6566

src/Umbraco.Web.UI.Client/src/libs/element-api/element.mixin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export const UmbElementMixin = <T extends HTMLElementConstructor>(superClass: T)
3535
// Fallback to use a hash of the provided method, but only if the alias is undefined and there is a callback.
3636
if (controllerAlias === undefined && callback) {
3737
controllerAlias = simpleHashCode(callback.toString());
38-
} else {
38+
} else if (controllerAlias === null) {
39+
// if value is null, then reset it to undefined. Null is used to explicitly tell that we do not want a controller alias. [NL]
3940
controllerAlias = undefined;
4041
}
4142

0 commit comments

Comments
 (0)