update: add error message for none user

This commit is contained in:
Senis John 2022-12-25 09:01:26 +08:00
parent 9c6ae5b7ab
commit 0c2d03f3e0
No known key found for this signature in database
GPG Key ID: 845E9E4727C3E1A4

View File

@ -3,6 +3,7 @@ package v2board
import ( import (
"bufio" "bufio"
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"log" "log"
"os" "os"
@ -338,6 +339,8 @@ func (c *APIClient) ParseSSNodeResponse() (*api.NodeInfo, error) {
if len(*userInfo) > 0 { if len(*userInfo) > 0 {
port = (*userInfo)[0].Port port = (*userInfo)[0].Port
method = (*userInfo)[0].Method method = (*userInfo)[0].Method
} else {
return nil, errors.New("the number of node users is 0")
} }
// Create GeneralNodeInfo // Create GeneralNodeInfo