From bd456a1dfaf6dcdd869f2adc059fd963740bf5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Thu, 9 Jan 2025 20:28:58 +0100 Subject: [PATCH] correct null case --- src/Umbraco.Web.UI.Client/src/libs/class-api/class.mixin.ts | 3 ++- .../src/libs/element-api/element.mixin.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/libs/class-api/class.mixin.ts b/src/Umbraco.Web.UI.Client/src/libs/class-api/class.mixin.ts index 3cb7f91fc0c7..0b1c893bcdb7 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/class-api/class.mixin.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/class-api/class.mixin.ts @@ -59,7 +59,8 @@ export const UmbClassMixin = >(superClas // Fallback to use a hash of the provided method, but only if the alias is undefined and there is a callback. if (controllerAlias === undefined && callback) { controllerAlias = simpleHashCode(callback.toString()); - } else { + } else if (controllerAlias === null) { + // if value is null, then reset it to undefined. Null is used to explicitly tell that we do not want a controller alias. [NL] controllerAlias = undefined; } diff --git a/src/Umbraco.Web.UI.Client/src/libs/element-api/element.mixin.ts b/src/Umbraco.Web.UI.Client/src/libs/element-api/element.mixin.ts index dfb35472e9d7..9b46710c58b4 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/element-api/element.mixin.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/element-api/element.mixin.ts @@ -35,7 +35,8 @@ export const UmbElementMixin = (superClass: T) // Fallback to use a hash of the provided method, but only if the alias is undefined and there is a callback. if (controllerAlias === undefined && callback) { controllerAlias = simpleHashCode(callback.toString()); - } else { + } else if (controllerAlias === null) { + // if value is null, then reset it to undefined. Null is used to explicitly tell that we do not want a controller alias. [NL] controllerAlias = undefined; }