Skip to content

Commit 3156c60

Browse files
authored
Merge pull request #175 from SumoLogic/vishal-handle-optional-timerange
Handle optional time range in Panel
2 parents cf9ddc2 + 928ac91 commit 3156c60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sumologic/resource_sumologic_dashboard.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,8 @@ func getSumoSearchPanel(tfSearchPanel map[string]interface{}) interface{} {
767767
if description, ok := tfSearchPanel["description"].(string); ok {
768768
searchPanel.Description = description
769769
}
770-
if val, ok := tfSearchPanel["time_range"]; ok {
771-
tfTimeRange := val.([]interface{})[0]
770+
if val := tfSearchPanel["time_range"].([]interface{}); len(val) == 1 {
771+
tfTimeRange := val[0]
772772
searchPanel.TimeRange = getTimeRange(tfTimeRange.(map[string]interface{}))
773773
}
774774

0 commit comments

Comments
 (0)