only load CSV when data exists (#42441)

This commit is contained in:
Will Browne 2021-11-29 14:21:18 +00:00 committed by GitHub
parent d997e051c2
commit e440796cb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,10 @@ func (s *Service) handleCsvContentScenario(ctx context.Context, req *backend.Que
}
csvContent := model.Get("csvContent").MustString()
if len(csvContent) == 0 {
return backend.NewQueryDataResponse(), nil
}
alias := model.Get("alias").MustString("")
frame, err := LoadCsvContent(strings.NewReader(csvContent), alias)