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.
The following code occasionally causes a crash on Android.
Error report from @kevcrooks
This is fixed by changing to:
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.