-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Labels
Resolution/ImplementedThe described enhancement or housekeeping work has been implemented.The described enhancement or housekeeping work has been implemented.Type/Enhancement
Description
The following code occasionally causes a crash on Android.
do let colDict = CSharpMath.Structures.Color.PredefinedColors
colDict.Remove("green",CSharpMath.Structures.Color(0uy,128uy,0uy)) |> ignore
colDict.Add("green",CSharpMath.Structures.Color(130uy,212uy,20uy))Error report from @kevcrooks
The exception is
System.ArgumentException: Duplicate second Parameter name: second
My thought is perhaps this line of code is being run twice, if a user has closed and re-opened the app or something.
This is fixed by changing to:
do let colDict = CSharpMath.Structures.Color.PredefinedColors
colDict.Remove("green",CSharpMath.Structures.Color(colDict.["green"]) |> ignore
colDict.Add("green",CSharpMath.Structures.Color(130uy,212uy,20uy))But it would be better for .Remove in a BiDictionary<'A,'B> only to take one argument which would increase safety, and also for .Add not to throw exceptions.
Metadata
Metadata
Assignees
Labels
Resolution/ImplementedThe described enhancement or housekeeping work has been implemented.The described enhancement or housekeeping work has been implemented.Type/Enhancement