From 06edcb1be5477468c5abf47479e48bf3743ef55e Mon Sep 17 00:00:00 2001 From: Ceshion Date: Tue, 22 Sep 2020 03:40:10 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fixes=20"too=20many=20items"=20w?= =?UTF-8?q?hen=20names=20are=20null=20=20(#543)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 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. --- BetterJoyForCemu/3rdPartyControllers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BetterJoyForCemu/3rdPartyControllers.cs b/BetterJoyForCemu/3rdPartyControllers.cs index 1a41780..033a625 100644 --- a/BetterJoyForCemu/3rdPartyControllers.cs +++ b/BetterJoyForCemu/3rdPartyControllers.cs @@ -40,7 +40,7 @@ namespace BetterJoyForCemu { } public override string ToString() { - return name; + return name ?? $"Unidentified Device ({this.product_id})"; } public string Serialise() {