From c127d119b4106f9a67b0647a84100068cc53a339 Mon Sep 17 00:00:00 2001 From: Alex Pop Date: Mon, 22 Oct 2018 18:34:56 +0100 Subject: [PATCH] Fix nil exception when no zones are returned for a region Signed-off-by: Alex Pop --- libraries/google_compute_region.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/google_compute_region.rb b/libraries/google_compute_region.rb index b6ae25b25..c2f17f226 100644 --- a/libraries/google_compute_region.rb +++ b/libraries/google_compute_region.rb @@ -26,7 +26,7 @@ def initialize(opts = {}) # helper for returning a list of zone short names rather than fully qualified URLs e.g. # https://www.googleapis.com/compute/v1/projects/spaterson-project/zones/asia-east1-a def zone_names - return false if !defined?(@region.zones) + return [] if @region.zones.nil? @region.zones.map { |zone| zone.split('/').last } end