From 8a507b7a5457c293bccb0f5c2c7dd1d44114b2c9 Mon Sep 17 00:00:00 2001 From: Hui Ling Shi Date: Wed, 27 Jul 2022 13:09:44 +0000 Subject: [PATCH] Fix SFLayer TypeErrors in Winscope Fix the errors that pop up when clicking `SurfaceFlingerLayer` in SurfaceFlingerTrace panel's Hierarchy panel, by taking care of cases where the property is null. Bug: 240405932 Test: manual on local build of Winscope Change-Id: Ic9e8f6e75dcfde8af97aeb5254d1e2d8f7b3d669 --- tools/winscope/src/SurfaceFlingerTraceView.vue | 2 +- tools/winscope/src/TransformMatrix.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/winscope/src/SurfaceFlingerTraceView.vue b/tools/winscope/src/SurfaceFlingerTraceView.vue index 8cd94da07..602a93b99 100644 --- a/tools/winscope/src/SurfaceFlingerTraceView.vue +++ b/tools/winscope/src/SurfaceFlingerTraceView.vue @@ -37,7 +37,7 @@ export default { summarizer(layer) { const summary = []; - if (layer?.visibilityReason.length > 0) { + if (layer?.visibilityReason?.length > 0) { let reason = ""; if (Array.isArray(layer.visibilityReason)) { reason = layer.visibilityReason.join(", "); diff --git a/tools/winscope/src/TransformMatrix.vue b/tools/winscope/src/TransformMatrix.vue index c5541364a..d8b7a8363 100644 --- a/tools/winscope/src/TransformMatrix.vue +++ b/tools/winscope/src/TransformMatrix.vue @@ -13,7 +13,7 @@ limitations under the License. -->