Skip to content

Commit

Permalink
Fix nil exception when no zones are returned for a region
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Pop <[email protected]>
  • Loading branch information
alexpop authored and Stuart Paterson committed Oct 23, 2018
1 parent 013d687 commit 1892fa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/google_compute_region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1892fa2

Please sign in to comment.