mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-23 16:43:52 +00:00
Loosen applist XML validation to accept empty app names
This matches the behavior of the Android and iOS clients. Fixes #1921
This commit is contained in:
1 parent
5034a324b4
commit
cdacb3d28d
2 files changed
+13
-2
No files matched your search
+10
-1
@@ -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 <AppTitle/>,
|
||||
// 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();
|
||||
|
||||
Reference in new issue
Block a user