5
0
Fork 0

Fix #8 assign to nil map

master
Daniel Lim 2019-08-31 11:20:28 +08:00
parent 577946bb39
commit 930bdabb55
1 changed files with 4 additions and 0 deletions

View File

@ -230,6 +230,10 @@ func NewConnection(w http.ResponseWriter, r *http.Request, p httprouter.Params)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
return
}
if _, ok := userTracks[user.UserId]; !ok {
userTracks[user.UserId] = make(map[string]*webrtc.Track)
}
userTracks[user.UserId][user.ClientId] = track
// Do signalling things