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:
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) {
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue