Skip to content

Commit

Permalink
fix null check
Browse files Browse the repository at this point in the history
Signed-off-by: Tim <32556895+Avarei@users.noreply.github.com>
  • Loading branch information
Avarei committed Jun 30, 2024
1 parent ddc43cc commit b6627f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkl/crossplane.contrib.example/full.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ meta = if (request.meta != null) new ResponseMeta {
ttl = 60.s
} else null

local observedObj: Object? = request.observed.resources.getOrNull("cm-one").resource as Object?
local observedObjSyncedCondition: Object.Condition? = observedObj.ifNonNull(
(obj: Object) -> obj.status.conditions.toList().findOrNull(
local observedObj: Object? = request.observed.resources.getOrNull("cm-one")?.resource as Object?
local observedObjSyncedCondition: Object.Condition? = observedObj?.status?.conditions?.ifNonNull(
(conds: Listing<Condition>) -> conds.toList().findOrNull(
(cond: Object.Condition) -> cond.type == "Synced"
)
)
Expand Down

0 comments on commit b6627f0

Please sign in to comment.