1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-02 07:58:31 +00:00

handle null clientid in ArgumetnsAsTwoStrings

This commit is contained in:
Kane York 2015-10-28 16:07:51 -07:00
parent 59ba6d52f6
commit 43d596ad07

View file

@ -96,8 +96,6 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) {
}
func ServeWebsocketOrCatbag(w http.ResponseWriter, r *http.Request) {
fmt.Println("hi")
fmt.Println(r.Header)
if r.Header.Get("Connection") == "Upgrade" {
conn, err := SocketUpgrader.Upgrade(w, r, nil)
if err != nil {
@ -397,6 +395,10 @@ func (cm *ClientMessage) ArgumentsAsTwoStrings() (string1, string2 string, err e
err = ExpectedTwoStrings
return
}
// clientID can be null
if ary[1] == nil {
return string1, "", nil
}
string2, ok = ary[1].(string)
if !ok {
err = ExpectedTwoStrings