This message was deleted.
# general
s
This message was deleted.
c
TS doesn’t yet have null safe calls. You have to check if it’s defined first I believe.
Is there something special about the export on its own then?
c
Are you getting an actual error, or is your IDE warning you?
q
IDE
I guess I can ignore that and run it ? 😛
c
Right
Obviously you’ll want to fix it though
c
You could add a check above that line to see if
accessConfigs
is
undefined
by doing something like this:
Copy code
if (!computeInstance.networkInterfaces[0].accessConfigs) {
  // Do something when it doesn't have a value. Maybe throw an error?
}
That should get rid of the IDE warning that it could be
undefined
. The other thing you could do is use the assertion operation
!
like this:
computeInstance.networkInterfaces[0].accessConfigs[0]!.natIp
, but this is not really recommended unless you know for sure that it cannot be undefined/null ever.
q
Thanks 🙂