Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fehlermeldung wenn keine Buchungen vorhanden #59

Merged
merged 3 commits into from Nov 2, 2023

Conversation

dippeal
Copy link
Member

@dippeal dippeal commented Oct 30, 2023

Gibt eine Fehlermeldung aus, wenn noch keine Buchung vorhanden ist.

@willuhn
Copy link
Member

willuhn commented Nov 1, 2023

Ich würde es deutlich lesbarer finden, wenn du oben lediglich folgendes eingefügt hättest:

if (list == null || !list.hasNext())
{
  throw new ApplicationException("Abbruch! Es existiert noch keine Buchung.");
}

Dann müsste nicht der gesamte folgende Block in eine if-Bedingung verschoben werden. Durch die Umformatierungen kann ich nicht wirklich erkennen, ob und was sich in all den anderen Zeilen geändert hat.

@dippeal
Copy link
Member Author

dippeal commented Nov 1, 2023

Ich würde es deutlich lesbarer finden, wenn du oben lediglich folgendes eingefügt hättest:

if (list == null || !list.hasNext())
{
  throw new ApplicationException("Abbruch! Es existiert noch keine Buchung.");
}

Dann müsste nicht der gesamte folgende Block in eine if-Bedingung verschoben werden. Durch die Umformatierungen kann ich nicht wirklich erkennen, ob und was sich in all den anderen Zeilen geändert hat.

Ich habe den Code umgebaut wie du vorgeschlagen hast. Durch die Einrückung des else Block kommt es im diff zu den vielen Zeilen Änderung.
Primäre Änderungen Z. 29-30 und Z. 135-141.

@willuhn
Copy link
Member

willuhn commented Nov 1, 2023

Das "else" kannst du weglassen. Wenn die if-Bedingung zum Tragen kommt, wird eine Exception geworfen und die Methode wird verlassen.

Copy link
Member

@willuhn willuhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sieht gut aus

@dippeal dippeal requested a review from NicoB77 November 1, 2023 11:01
@willuhn willuhn merged commit 9db888c into openjverein:master Nov 2, 2023
@dippeal dippeal deleted the fix/buchungen-empty branch November 2, 2023 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants