Skip to content

Commit

Permalink
Fix issue #126
Browse files Browse the repository at this point in the history
NoSuchMethodError: The method '[]' was called on null.
  • Loading branch information
vyPal committed Sep 20, 2023
1 parent 4c80504 commit 612f9db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,10 @@ class HomePageState extends State<HomePage> {
const TextStyle(fontSize: 20),
),
Text(
lesson["classrooms"][0]["short"],
lesson["classrooms"].length > 0
? lesson["classrooms"][0]
["short"]
: "?",
style:
const TextStyle(fontSize: 14),
),
Expand Down

0 comments on commit 612f9db

Please sign in to comment.