dolphhinsr_dart
dolphhinsr_dart copied to clipboard
There should be an explicit exception thrown when combinations refers to non existent fields
Imagine a card like this:
Master(
id: sw.getKey(word),
fields: ["x", "y"],
combinations: [
Combination(front: [0], back: [1]),
Combination(front: [1], back: [2]),
],
);
This is invalid because there are only two fields but we erroneously refer to index 2 in the second combination.
This results in a tricky to debug error inside the library:
RangeError (RangeError (index): Invalid value: Not in inclusive range 0..1: 2)
Instead we should have an explicit exception.
I can make a PR for this some time later.