Skip to content

Commit

Permalink
Fix: Aspect ratio exception when height is 0 (#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
ib-8 committed May 9, 2023
1 parent 07f112a commit ed75f8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/custom_render.dart
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ double _aspectRatio(
if (heightString != null && widthString != null) {
final height = double.tryParse(heightString);
final width = double.tryParse(widthString);
return height == null || width == null
return height == null || width == null || height == 0.0
? calculated.data!.aspectRatio
: width / height;
}
Expand Down

0 comments on commit ed75f8f

Please sign in to comment.