I'm a little surprised you need to test for `null`...
# general
w
I'm a little surprised you need to test for
null
in that code - the callback should only run when the
networkConfiguration
is available. Were you seeing otherwise?
f
Compilation fails with
TS2532: Object is possibly 'undefined'.
if I remove the
null
check.
strictNullChecks
is set to
true
.
w
Ahh - I see - it's possible for this
networkConfiguration
to be missing from a valid ECS Service, so it can indeed be
undefined
. Nice that
strictNullChecks
catches this. You should be able to add back that check in a variant like what I shared as well if that looks simpler to you.
f
Indeed it does. Thanks 🙂