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
This commit is contained in:
Hui Ling Shi
2022-07-27 13:09:44 +00:00
parent 595c67d790
commit 8a507b7a54
2 changed files with 2 additions and 2 deletions

View File

@@ -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(", ");

View File

@@ -13,7 +13,7 @@
limitations under the License.
-->
<template>
<div class="matrix">
<div class="matrix" v-if="transform">
<md-tooltip>{{ transform.getTypeAsString() }}</md-tooltip>
<div class="cell">{{ formatFloat(transform.matrix.dsdx) }}</div>
<div class="cell">{{ formatFloat(transform.matrix.dsdy) }}</div>