diff options
| author | 2023-12-06 17:01:14 +0100 | |
|---|---|---|
| committer | 2023-12-08 11:41:16 +0100 | |
| commit | 0fcfc928ff78b9d008c7a9995e4c99b72eb91b2e (patch) | |
| tree | 84b1ad2694d64db2bdbc1949a04b6cd28cc40332 | |
| parent | 54b89873ae5c12d02f469eb4c68eb4b39253eb46 (diff) | |
Do not throw when element is present in neither from- or toScene
Bug: 311600838
Test: N/A
Flag: N/A
Change-Id: Id2678cf2e3b80a08066889e2b42ef8f3eff6a52f
| -rw-r--r-- | packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt index 2b1195229c76..fb8083b78a1c 100644 --- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt +++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt @@ -615,7 +615,9 @@ private inline fun <T> computeValue( val toValues = element.sceneValues[toScene] if (fromValues == null && toValues == null) { - error("This should not happen, element $element is neither in $fromScene or $toScene") + // TODO(b/311600838): Throw an exception instead once layers of disposed elements are not + // run anymore. + return lastValue() } // The element is shared: interpolate between the value in fromScene and the value in toScene. |