Skip to content

Commit 3a16179

Browse files
authored
Only access renderObject if hasSize is true (#2263)
1 parent 7b2e0ad commit 3a16179

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8360)
3939
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.35.1...8.36.0)
4040

41+
### Fixes
42+
43+
- Only access renderObject if `hasSize` is true ([#2263](https://github.com/getsentry/sentry-dart/pull/2263))
44+
4145
## 8.8.0
4246

4347
### Features

flutter/lib/src/view_hierarchy/sentry_tree_walker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class _TreeWalker {
255255
double? alpha;
256256

257257
final renderObject = element.renderObject;
258-
if (renderObject is RenderBox) {
258+
if (renderObject is RenderBox && renderObject.hasSize) {
259259
final offset = renderObject.localToGlobal(Offset.zero);
260260
if (offset.dx > 0) {
261261
x = offset.dx;

0 commit comments

Comments
 (0)