forked from firka/student-legacy
maybe fixed timetable clear bug on kreten api error
This commit is contained in:
parent
1c49ffd57f
commit
399069537f
@ -65,8 +65,14 @@ class TimetableProvider with ChangeNotifier {
|
|||||||
User? user = _user.user;
|
User? user = _user.user;
|
||||||
if (user == null) throw "Cannot fetch Lessons for User null";
|
if (user == null) throw "Cannot fetch Lessons for User null";
|
||||||
String iss = user.instituteCode;
|
String iss = user.instituteCode;
|
||||||
List? lessonsJson = await _kreta
|
|
||||||
.getAPI(KretaAPI.timetable(iss, start: week.start, end: week.end));
|
List? lessonsJson;
|
||||||
|
try {
|
||||||
|
lessonsJson = await _kreta
|
||||||
|
.getAPI(KretaAPI.timetable(iss, start: week.start, end: week.end));
|
||||||
|
} catch (e) {
|
||||||
|
lessonsJson = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (lessonsJson == null) {
|
if (lessonsJson == null) {
|
||||||
if (kDebugMode) print('Cannot fetch Lessons for User ${user.id}');
|
if (kDebugMode) print('Cannot fetch Lessons for User ${user.id}');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user