Skip to content

Commit

Permalink
fix null check
Browse files Browse the repository at this point in the history
Signed-off-by: Tim <[email protected]>
  • Loading branch information
Avarei committed Aug 31, 2024
1 parent 3161d51 commit 479df7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkl/crossplane.contrib.example/compositions/steps/full.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ meta = if (request.meta != null) new {
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 479df7b

Please sign in to comment.