robolson / ruby-poker

Ruby library for comparing poker hands and determining the winner.
BSD 3-Clause "New" or "Revised" License
99 stars 43 forks source link

critical bug #2

Closed jeffreybasurto closed 10 years ago

jeffreybasurto commented 14 years ago

Crashes under certain circumstances when evaluating two pair because of passing nil to function that uses upper! on nil.

Easily reproduced when running a simulation of 100 texas poker hands. Temporarily fixed by adding a return if !arg. Not sure about the consequences yet to the fidelity of the library.

robolson commented 14 years ago

Thanks for the submission Jeffrey. It's on my radar and I will take a look at it when I get a chance.

robolson commented 10 years ago

Hi @jeffreybasurto! I know it's been 3 years but I think I fixed this in 4c2402b0bb301d0974dc8477ed6c52f9f54cca49. I just pushed a 1.0.0 release which includes the fix. You did not include a specific example of a hand that causes the failure so I can't be positive but I tested the library against a million sample hands and it did not crash.