Skip to content

Commit 9827cfd

Browse files
committed
Update localization.controller.ts
1 parent 90c66f6 commit 9827cfd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Umbraco.Web.UI.Client/src/libs/localization-api/localization.controller.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ export class UmbLocalizationController<LocalizationSetType extends UmbLocalizati
222222
* @returns {Array<string>} An array of keys.
223223
*/
224224
getKeysFromString(text: string): Array<string> {
225+
if (typeof text !== 'string') {
226+
return [];
227+
}
228+
225229
const regex = /#\w+/g;
226230
const keys = text.match(regex) || [];
227231
return keys.map((key) => key.slice(1));

0 commit comments

Comments
 (0)