mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-15 17:46:55 +00:00
handle null clientid in ArgumetnsAsTwoStrings
This commit is contained in:
parent
59ba6d52f6
commit
43d596ad07
1 changed files with 4 additions and 2 deletions
|
@ -96,8 +96,6 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ServeWebsocketOrCatbag(w http.ResponseWriter, r *http.Request) {
|
func ServeWebsocketOrCatbag(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Println("hi")
|
|
||||||
fmt.Println(r.Header)
|
|
||||||
if r.Header.Get("Connection") == "Upgrade" {
|
if r.Header.Get("Connection") == "Upgrade" {
|
||||||
conn, err := SocketUpgrader.Upgrade(w, r, nil)
|
conn, err := SocketUpgrader.Upgrade(w, r, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -397,6 +395,10 @@ func (cm *ClientMessage) ArgumentsAsTwoStrings() (string1, string2 string, err e
|
||||||
err = ExpectedTwoStrings
|
err = ExpectedTwoStrings
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// clientID can be null
|
||||||
|
if ary[1] == nil {
|
||||||
|
return string1, "", nil
|
||||||
|
}
|
||||||
string2, ok = ary[1].(string)
|
string2, ok = ary[1].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
err = ExpectedTwoStrings
|
err = ExpectedTwoStrings
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue