From 4c6c811938afe3524a50b3101a26c653f9076ba0 Mon Sep 17 00:00:00 2001 From: Nico Esteves Date: Mon, 11 Jun 2018 16:50:22 +0200 Subject: [PATCH] Fix nil dereference --- VERSION | 2 +- ec2/ip-from-name/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 37c2d99..ade6522 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.4 +5.4.1 diff --git a/ec2/ip-from-name/main.go b/ec2/ip-from-name/main.go index ef0c7c8..8dc023d 100644 --- a/ec2/ip-from-name/main.go +++ b/ec2/ip-from-name/main.go @@ -40,7 +40,7 @@ func main() { for _, reservation := range resp.Reservations { if len(reservation.Instances) > 0 { instance := reservation.Instances[0] - if instance != nil { + if instance != nil && instance.PrivateIpAddress != nil { ips = append(ips, *instance.PrivateIpAddress) } }