From 0fb0c97a4426a07bcee97cbc8d8b5990c0207020 Mon Sep 17 00:00:00 2001 From: broodjeaap89 Date: Tue, 13 Jul 2021 19:29:42 +0200 Subject: [PATCH] fixed a null error when the user backs out of the confirm new pizza event dialog --- lib/pages/AddPizzaEventPage.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pages/AddPizzaEventPage.dart b/lib/pages/AddPizzaEventPage.dart index b67ddeb..fbe8671 100644 --- a/lib/pages/AddPizzaEventPage.dart +++ b/lib/pages/AddPizzaEventPage.dart @@ -186,12 +186,15 @@ class AddPizzaEventPageState extends State { } setState(() { this.nameValidation = false; }); FocusScope.of(context).unfocus(); - DateTime eventTime = await showDialog( + DateTime? eventTime = await showDialog( context: context, builder: (context) { return ConfirmPizzaEventDialog(name: name, pizzaRecipe: pizzaRecipe, pizzaCount: pizzaCount, doughBallSize: doughBallSize); } ); + if (eventTime == null){ + return; + } Navigator.pop(context, PizzaEvent( this.name, this.pizzaRecipe,