Skip to content

Commit

Permalink
Add null check
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay committed Jan 11, 2018
1 parent 1f21f99 commit 3119246
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/storage/es/spanstore/writer.go
Expand Up @@ -147,7 +147,7 @@ func (s *SpanWriter) createIndex(indexName string, mapping string, jsonSpan *jMo
s.writerMetrics.indexCreate.Emit(err, time.Since(start))
if err != nil {
eErr, ok := err.(*elastic.Error)
if !ok || eErr.Details.Type != "index_already_exists_exception" {
if !ok || eErr.Details != nil && eErr.Details.Type != "index_already_exists_exception" {
return s.logError(jsonSpan, err, "Failed to create index", s.logger)
}
}
Expand Down

0 comments on commit 3119246

Please sign in to comment.