This is an automated email from the ASF dual-hosted git repository.

dominikriemer pushed a commit to branch fix-sorting-homepage
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 7905d0fcfd897c4ba048c9318de152127b6b6e85
Author: Dominik Riemer <[email protected]>
AuthorDate: Tue Jun 16 17:52:39 2026 +0200

    fix: Check asset links for null values before sorting
---
 ui/src/app/home/home.component.ts | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ui/src/app/home/home.component.ts 
b/ui/src/app/home/home.component.ts
index a73f4303aa..892be4b897 100644
--- a/ui/src/app/home/home.component.ts
+++ b/ui/src/app/home/home.component.ts
@@ -171,13 +171,15 @@ export class HomeComponent implements OnInit, OnDestroy {
 
     sortAssetLinks(assets: SpAssetModel[]) {
         assets.forEach(asset => {
-            asset.assetLinks = [...asset.assetLinks].sort((a, b) => {
-                const typeCompare = a.linkType.localeCompare(b.linkType);
+            asset.assetLinks = [...(asset.assetLinks ?? [])].sort((a, b) => {
+                const leftType = a.linkType ?? '';
+                const rightType = b.linkType ?? '';
+                const typeCompare = leftType.localeCompare(rightType);
                 if (typeCompare !== 0) {
                     return typeCompare;
                 }
 
-                return a.linkLabel.localeCompare(b.linkLabel);
+                return (a.linkLabel ?? '').localeCompare(b.linkLabel ?? '');
             });
         });
     }

Reply via email to