Skip to content

Commit

Permalink
fix(#706): add null check to _getDrugWithBrandNames
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 6, 2024
1 parent 71cd73b commit e807f98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/common/models/drug/drug.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ String _getDrugWithBrandNames(
String drugName,
{ required bool capitalize }
) {
final drug = CachedDrugs.instance.drugs!.firstOrNullWhere(
final drug = CachedDrugs.instance.drugs?.firstOrNullWhere(
(drug) => drug.name == drugName
);
final displayedDrugName = capitalize ? drugName.capitalize() : drugName;
Expand Down

0 comments on commit e807f98

Please sign in to comment.