Seji64 / LAPS-WebUI

A nice and simple Web Interface for LAPS (Local Administrator Password Solution)
MIT License
29 stars 6 forks source link

Repeated search for same computer results in error #17

Closed Pinkbyte closed 1 year ago

Pinkbyte commented 1 year ago

Steps to reproduce: 1) search for some computer, that is present in Active Directory (for example - TEST1); 2) select computer, adding it to the list below search prompt; 3) Hit 'X' to delete computer from list below search prompt; 4) search again for TEST1; 5) try to add it again to the list;

Result - nothing happens on client - computer is not added to the list. On server there is error in logs:

System.ArgumentException: An item with the same key has already been added. Key: TEST
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at LAPS_WebUI.Pages.LAPS.OnSelectedItemChangedAsync(ADComputer value) in /src/Pages/LAPS.razor.cs:line 35

LAPS-WebUI version: 1.5.5, used from docker container