From ce3eff0304465f63510a881d9ce150484d7dedcc Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 18 Feb 2021 23:17:41 +0100 Subject: [PATCH] Accept more exception errors from the API --- lib/helpers/ui.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/helpers/ui.dart b/lib/helpers/ui.dart index 5096b05ac..a7eeb719a 100644 --- a/lib/helpers/ui.dart +++ b/lib/helpers/ui.dart @@ -55,8 +55,12 @@ void showHttpExceptionErrorDialog(WgerHttpException exception, BuildContext cont errorList.add(Text(key, style: TextStyle(fontWeight: FontWeight.bold))); // Error messages - for (var value in exception.errors[key]) { - errorList.add(Text(value)); + if (exception.errors[key] is String) { + errorList.add(Text(exception.errors[key])); + } else { + for (var value in exception.errors[key]) { + errorList.add(Text(value)); + } } errorList.add(SizedBox(height: 8)); }