Don't crash when daos can't be read (#601)

This commit is contained in:
Simon Binder 2020-05-28 11:17:03 +02:00
parent 231efe26a7
commit 074c9d973d
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 5 additions and 4 deletions

View File

@ -38,9 +38,10 @@ class UseMoorParser {
List<DartType> _readDaoTypes(ConstantReader annotation) {
return annotation
.peek('daos')
.listValue
.map((obj) => obj.toTypeValue())
.toList();
.peek('daos')
?.listValue
?.map((obj) => obj.toTypeValue())
?.toList() ??
[];
}
}