From 5ff7aa9cc8d0c72fa6395b04ae55d86f6bdacdfe Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 2 Sep 2024 18:15:30 +0200 Subject: [PATCH 1/2] Only access renderObject if `hasSize` is true --- flutter/lib/src/view_hierarchy/sentry_tree_walker.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/src/view_hierarchy/sentry_tree_walker.dart b/flutter/lib/src/view_hierarchy/sentry_tree_walker.dart index b2e759b2c9..578792d18a 100644 --- a/flutter/lib/src/view_hierarchy/sentry_tree_walker.dart +++ b/flutter/lib/src/view_hierarchy/sentry_tree_walker.dart @@ -255,7 +255,7 @@ class _TreeWalker { double? alpha; final renderObject = element.renderObject; - if (renderObject is RenderBox) { + if (renderObject is RenderBox && renderObject.hasSize) { final offset = renderObject.localToGlobal(Offset.zero); if (offset.dx > 0) { x = offset.dx; From 27aa6ffe8f512ebd7d15e670186c08fcdbbf112e Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 2 Sep 2024 18:19:58 +0200 Subject: [PATCH 2/2] add cl entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a486e6eb1a..34faadb066 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,10 @@ - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8360) - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.35.1...8.36.0) +### Fixes + +- Only access renderObject if `hasSize` is true ([#2263](https://github.com/getsentry/sentry-dart/pull/2263)) + ## 8.8.0 ### Features