Symptom

After upgrading krill-sdk to 0.0.49, four callers of NodeHttp.readNodes() crash or behave incorrectly because the return type changed from List<Node> to List<Node>?. Specifically, ConnectPeer.kt would NPE in LaunchedEffect; PeerObservationClient.kt would NPE after runCatching succeeded with a null value.

Root cause

readNodes() now returns null on network/HTTP failure rather than emptyList(), so callers can distinguish “server unreachable” from “server has no nodes”. Call sites that assumed a non-null return either called .forEach on a null reference, or (in PeerObservationClient) had runCatching swallow the exception-based path but were not guarded against the new null-success path.

Fix

Prevention