From 80e48de9dac8f6697437b0b94e04568079fadfe2 Mon Sep 17 00:00:00 2001 From: RainVisitor Date: Wed, 3 Jun 2020 19:32:33 +0800 Subject: [PATCH] Improve error check --- lib/pages/leave/leave_apply_page.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/pages/leave/leave_apply_page.dart b/lib/pages/leave/leave_apply_page.dart index 0599c1c2..4d0e6287 100644 --- a/lib/pages/leave/leave_apply_page.dart +++ b/lib/pages/leave/leave_apply_page.dart @@ -554,12 +554,13 @@ class LeaveApplyPageState extends State Helper.instance.getLeavesSubmitInfo( callback: GeneralCallback( onSuccess: (LeaveSubmitInfoData data) { - if (data != null) { - setState(() { + setState(() { + if (data != null) { leaveSubmitInfo = data; state = _State.finish; - }); - } + } else + state = _State.error; + }); }, onFailure: (DioError e) { if (mounted)