From 0aca03158c929d8d188731a0e46b49ec4d52e667 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 3 Aug 2015 21:38:17 +0100 Subject: [PATCH] Fix a divide by zero crash in TabCompletionLogic. --- OpenRA.Mods.Common/Widgets/Logic/TabCompletionLogic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/TabCompletionLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/TabCompletionLogic.cs index 0589daea61..fcc5b490e3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/TabCompletionLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/TabCompletionLogic.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (string.IsNullOrWhiteSpace(text)) return text; - if (lastCompleted == text) + if (lastCompleted == text && candidates.Any()) { lastCompleted = prefix + candidates[++currentCandidateIndex % candidates.Count] + suffix; return lastCompleted;