Skip to content
This repository was archived by the owner on Dec 1, 2018. It is now read-only.

Commit b3cfb10

Browse files
committed
Fix nil pointer dereference when a sink return (nil, err)
1 parent 779eb8a commit b3cfb10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

events/sinks/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (this *SinkFactory) BuildAll(uris flags.Uris) []core.EventSink {
5959
for _, uri := range uris {
6060
sink, err := this.Build(uri)
6161
if err != nil {
62-
glog.Errorf("Failed to create sink: %v", err)
62+
glog.Errorf("Failed to create %s sink: %v", uri, err)
6363
continue
6464
}
6565
result = append(result, sink)

metrics/sinks/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (this *SinkFactory) BuildAll(uris flags.Uris, historicalUri string, disable
8787
for _, uri := range uris {
8888
sink, err := this.Build(uri)
8989
if err != nil {
90-
glog.Errorf("Failed to create %s sink: %v", sink.Name(), err)
90+
glog.Errorf("Failed to create %s sink: %v", uri, err)
9191
continue
9292
}
9393
if uri.Key == "metric" {

0 commit comments

Comments
 (0)