diff --git a/lib/api/data_api.dart b/lib/api/data_api.dart index 6c9ba28..c683386 100644 --- a/lib/api/data_api.dart +++ b/lib/api/data_api.dart @@ -123,9 +123,9 @@ class DataApi { var electiveSubjectDetails = []; - if (response.data[1] != null || - response.data[1]['subject'] != null || - response.data[1] != []) { + if ( + response.data.length >= 2 && + (response.data[1] != null && response.data[1]['subject'] != null && response.data[1] != [])) { electiveSubjectDetails = List.from( response.data[1]['subject'].map( (sub) => SubjectDetails.fromJson(sub),