Skip to content

Commit

Permalink
Fix wasm casting error (flutter#8474)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzieschmoll authored and mossmana committed Oct 31, 2024
1 parent 48fc9aa commit 7bd46dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class LoggingController extends DisposableController
final message = jsonEncode(event);
log(
LogData(
'gc',
_gcFilterId,
message,
e.timestamp,
summary: summary,
Expand Down
16 changes: 10 additions & 6 deletions packages/devtools_app/lib/src/screens/logging/metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,16 @@ class MetadataChips extends StatelessWidget {
// Prepare frame time chip.
String? elapsedFrameTimeAsString;
try {
final int micros = (jsonDecode(data.details!) as Map)['elapsed'];
elapsedFrameTimeAsString = durationText(
Duration(microseconds: micros),
unit: DurationDisplayUnit.milliseconds,
fractionDigits: 2,
);
if (data.details != null) {
final int? micros = (jsonDecode(data.details!) as Map)['elapsed'];
if (micros != null) {
elapsedFrameTimeAsString = durationText(
Duration(microseconds: micros),
unit: DurationDisplayUnit.milliseconds,
fractionDigits: 2,
);
}
}
} catch (e) {
// Ignore exception; [elapsedFrameTimeAsString] will be null.
}
Expand Down

0 comments on commit 7bd46dc

Please sign in to comment.