From 4ecb2dcddcc38082a62b135fc3d2ded6034e197a Mon Sep 17 00:00:00 2001 From: MilovdZee Date: Sun, 17 Dec 2023 20:11:47 +0100 Subject: [PATCH] Fix stacktrace in console handler --- lib/handlers/console_handler.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/handlers/console_handler.dart b/lib/handlers/console_handler.dart index 7bba499..b3af604 100644 --- a/lib/handlers/console_handler.dart +++ b/lib/handlers/console_handler.dart @@ -41,7 +41,7 @@ class ConsoleHandler extends ReportHandler { ..info('${report.error}') ..info(''); if (enableStackTrace) { - _printStackTraceFormatted(report.stackTrace as StackTrace?); + _printStackTraceFormatted(report.stackTrace); } if (enableCustomParameters) { _printCustomParametersFormatted(report.customParameters); @@ -75,9 +75,9 @@ class ConsoleHandler extends ReportHandler { } } - void _printStackTraceFormatted(StackTrace? stackTrace) { + void _printStackTraceFormatted(stackTrace) { logger.info('------- STACK TRACE -------'); - stackTrace.toString().split('\n').forEach((entry) => logger.info(entry)); + stackTrace?.toString().split('\n').forEach((entry) => logger.info(entry)); } @override