Symptom

KrillApp.Avatar.processor() and MenuCommand.*.processor() would throw a misleading Exception("Krill App had a null processor interface") rather than a clear IllegalStateException explaining why those types have no processor. More critically: the when in KrillAppEmit.kt silently diverged from KrillAppMeta.kt — Avatar and MenuCommand were handled in meta but not in emit, meaning a future call site that dispatched on either type would crash at runtime with no compile-time warning.

Root cause

Commit 5810b427f (“fixing bugs from avatar”) added KrillApp.Avatar -> AvatarMetadata() to KrillAppMeta.kt but omitted the corresponding arm in KrillAppEmit.kt. MenuCommand was never added to either file’s exhaustive when as an explicit arm (it relied on else). The else branch previously returned null (no-op); a later refactor changed it to throw, but left the comment describing the old null behavior and neither added Avatar nor MenuCommand as explicit arms. The two files were structurally divergent with no compile-time guard.

Fix

Prevention