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.
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.
ClientServerConnector.kt: Added ?: return after readNodes() — null means network failure, already inside try/catch, bail out early.ServerView.kt: Checked for null explicitly and set refreshMessage = "server unreachable" to surface the failure to the user instead of crashing or silently claiming 0 nodes refreshed.ConnectPeer.kt: Changed .forEach to ?.forEach and moved ready.value = true outside the loop so the spinner clears even when the list is null or empty.PeerObservationClient.kt: Split the runCatching result into nodesOrNull, then added a null guard with an explicit logger.w before the early return, keeping both the exception path and the null-return path logged separately.grep -rn "readNodes" --include="*.kt".runCatching does not guard against null return values — only against thrown exceptions. Always null-check getOrElse results that could return null even on success.LaunchedEffect bodies, put state transitions (ready.value = true) after the awaited operation, not inside a forEach that may not execute.