🐛 fixes "too many items" when names are null (#543)

* 🐛 avert infinite loop when prod_id not assigned

Without ptr being reassigned in the case of a 0 prod_id, the app would get into an infinite loop on launch, before opening- this should resolve it 😊

* 🐛 fixes "too many items" when names are null

There is an (honestly misleading) OutOfMemoryException with the message "too many items in listbox" that is thrown when there are any items whose ToString() method returns null. This commit (in my maybe-biased opinion) gives a reasonable output in that case instead.
This commit is contained in:
Ceshion 2020-09-22 03:40:10 -04:00 committed by GitHub
parent aec0e1d2a8
commit 06edcb1be5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ namespace BetterJoyForCemu {
}
public override string ToString() {
return name;
return name ?? $"Unidentified Device ({this.product_id})";
}
public string Serialise() {