mirror of
https://github.com/kwsch/NHSE.git
synced 2026-08-23 11:06:02 -05:00
Ensure associated item search does not search for whitespace
This commit is contained in:
@@ -214,16 +214,17 @@ private static string GetItemName60000(ushort index)
|
||||
/// <returns>Map of ItemID, ItemName</returns>
|
||||
public List<ComboItem> GetAssociatedItems(ushort id, out string baseItemName)
|
||||
{
|
||||
baseItemName = string.Empty;
|
||||
var stringMatch = GetItemName(id);
|
||||
var index = stringMatch.IndexOf('(');
|
||||
if (index < 0)
|
||||
{
|
||||
baseItemName = string.Empty;
|
||||
return new List<ComboItem>();
|
||||
}
|
||||
|
||||
var search = baseItemName = stringMatch.Substring(0, index);
|
||||
return ItemDataSource.FindAll(x => x.Text.StartsWith(search));
|
||||
if (!string.IsNullOrWhiteSpace(search))
|
||||
return ItemDataSource.FindAll(x => x.Text.StartsWith(search));
|
||||
else
|
||||
return new List<ComboItem>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user