Skip to content

Commit fdd917a

Browse files
authored
Fix simple null pointer exception (#82)
* Update math.dart * Update selectable.dart
1 parent 8c8fabe commit fdd917a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/src/widgets/math.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class Math extends StatelessWidget {
187187
options = MathOptions(
188188
style: mathStyle,
189189
fontSize: effectiveTextStyle.fontSize! * textScaleFactor,
190-
mathFontOptions: effectiveTextStyle.fontWeight != FontWeight.normal
190+
mathFontOptions: effectiveTextStyle.fontWeight != FontWeight.normal && effectiveTextStyle.fontWeight != null
191191
? FontOptions(fontWeight: effectiveTextStyle.fontWeight!)
192192
: null,
193193
logicalPpi: logicalPpi,

lib/src/widgets/selectable.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class SelectableMath extends StatelessWidget {
242242
MathOptions(
243243
style: mathStyle,
244244
fontSize: effectiveTextStyle.fontSize! * textScaleFactor,
245-
mathFontOptions: effectiveTextStyle.fontWeight != FontWeight.normal
245+
mathFontOptions: effectiveTextStyle.fontWeight != FontWeight.normal && effectiveTextStyle.fontWeight != null
246246
? FontOptions(fontWeight: effectiveTextStyle.fontWeight!)
247247
: null,
248248
logicalPpi: logicalPpi,

0 commit comments

Comments
 (0)