diff --git a/lib/pages/InPatientServices/inpatient_home.dart b/lib/pages/InPatientServices/inpatient_home.dart index a79e40de..ffb5f57d 100644 --- a/lib/pages/InPatientServices/inpatient_home.dart +++ b/lib/pages/InPatientServices/inpatient_home.dart @@ -309,7 +309,7 @@ class _InPatientServicesHomeState extends State { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); service.getMedicalInstructions(projectViewModel.inPatientProjectID, context).then((res) { - if (res['MedicalInstruction'].length != 0) { + if (res['MedicalInstruction'] != null && res['MedicalInstruction'].length != 0) { List getMedicalInstructionsList = []; res['MedicalInstruction'].forEach((v) { getMedicalInstructionsList.add(new GetMedicalInstructions.fromJson(v)); @@ -318,6 +318,7 @@ class _InPatientServicesHomeState extends State { print(res['MedicalInstruction']); Navigator.push(context, FadePage(page: MedicalInstructionsPage(getMedicalInstructionsList: getMedicalInstructionsList))); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: TranslationBase.of(context).noMedicalInstructions); } }).catchError((err) {