From cdacb3d28dc9772bbf85e179cf51f8b25936df37 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 28 Jun 2026 12:18:42 -0500 Subject: [PATCH] Loosen applist XML validation to accept empty app names This matches the behavior of the Android and iOS clients. Fixes #1921 --- app/backend/nvapp.h | 4 +++- app/backend/nvhttp.cpp | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/backend/nvapp.h b/app/backend/nvapp.h index bf51db63..4fdd2865 100644 --- a/app/backend/nvapp.h +++ b/app/backend/nvapp.h @@ -25,7 +25,9 @@ public: bool isInitialized() { - return id != 0 && !name.isEmpty(); + // We use isNull() instead of isEmpty() here because we want + // to detect cases where the name is unassigned, not empty. + return id != 0 && !name.isNull(); } void diff --git a/app/backend/nvhttp.cpp b/app/backend/nvhttp.cpp index 76cd1d7b..f447b4ff 100644 --- a/app/backend/nvhttp.cpp +++ b/app/backend/nvhttp.cpp @@ -322,7 +322,16 @@ NvHTTP::getAppList() } else if (!apps.isEmpty()) { if (XML_NAME_EQUALS(name, "AppTitle")) { - apps.last().name = xmlReader.readElementText(); + // If an app has no name, Sunshine may send us , + // which readElementText() returns as a null QString. + // We want to treat this as an empty QString instead, so we + // will explicitly convert it. An empty string will satisfy + // NvApp's isInitialized() check. + QString name = xmlReader.readElementText(); + if (name.isNull()) { + name = ""; + } + apps.last().name = name; } else if (XML_NAME_EQUALS(name, "ID")) { apps.last().id = xmlReader.readElementText().toInt();