Add nil check to fix panic in storage bucket. (#2525)

This commit is contained in:
The Magician 2018-11-26 15:54:44 -08:00 committed by Nathan McKinley
parent e74ccfde23
commit 210141a5b1

View File

@ -358,7 +358,7 @@ func resourceStorageBucketUpdate(d *schema.ResourceData, meta interface{}) error
// Setting fields to "" to be explicit that the PATCH call will
// delete this field.
if len(websites) == 0 {
if len(websites) == 0 || websites[0] == nil {
sb.Website.NotFoundPage = ""
sb.Website.MainPageSuffix = ""
} else {