fix: guard nullable particle layer mix

This commit is contained in:
OpenAI Codex
2026-09-03 08:42:09 +08:00
parent e60a818863
commit 7a1ed80b0f

View File

@@ -145,9 +145,12 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
private fun setTimeMix(value: Float) {
val requestedTimeMix = value.coerceIn(0.0f, 1.0f)
val layer = maplibreMap.style?.getLayer(PARTICLE_LAYER_ID)
if (layer == null) {
Log.i(TAG, "ParticleGPU: event=MIX_REJECTED reason=LAYER_NOT_READY styleEpoch=$styleLoadEpoch")
return
}
val rejectReason = when {
!styleReady -> "STYLE_LOADING"
layer == null -> "LAYER_NOT_READY"
!enabled -> "DISABLED"
!timeWindowMode -> "TIME_WINDOW_OFF"
else -> null