Skip to content

Commit 5fd6cd3

Browse files
MINOR: Add type assertion for protocol
1 parent 9420fa5 commit 5fd6cd3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

consul/watcher.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ func (w *Watcher) startUpstream(up api.Upstream) {
165165
}
166166

167167
if up.Config["protocol"] != nil {
168-
u.Protocol = up.Config["protocol"].(string)
168+
if p, ok := up.Config["protocol"].(string); ok {
169+
u.Protocol = p
170+
}
169171
}
170172

171173
w.lock.Lock()

0 commit comments

Comments
 (0)