The PR does not address the real issue. The internal data structures should always be result in a valid XML feed, without the need to do checks like this one.
The core issue was that addMeal might add entry for a date or a category but afterwards raise an exception rejecting the meal leaving the internal state broken (maybe a category without meals). I fixed this and will therefore close/not merge this PR.
The PR does not address the real issue. The internal data structures should always be result in a valid XML feed, without the need to do checks like this one.
The core issue was that
addMeal
might add entry for a date or a category but afterwards raise an exception rejecting the meal leaving the internal state broken (maybe a category without meals). I fixed this and will therefore close/not merge this PR.