WillFlame14 / hanabi-bot

A bot that plays on the hanab.live interface.
GNU General Public License v3.0
14 stars 9 forks source link

Fix crash with empty range #317

Closed flackr closed 5 days ago

flackr commented 6 days ago

When we request an impossible range this function crashes. Adds an early return for this condition.

WillFlame14 commented 6 days ago

Is this related to the same issue as #316? I don't think it's a good idea to hide this kind of error, we shouldn't be requesting impossible ranges in the first place.

flackr commented 6 days ago

Is this related to the same issue as #316?

Yes, I think so.

I don't think it's a good idea to hide this kind of error, we shouldn't be requesting impossible ranges in the first place.

My intention wasn't to hide an error but to define a range where the end is less than the start as empty. But happy to fix it by changing the caller instead.