Skip to content

Commit

Permalink
Fix GetOnlineUserCount() panic
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Mar 5, 2024
1 parent 778f0fc commit 2c477f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions casdoor/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

package casdoor

import "github.com/casdoor/casdoor-go-sdk/casdoorsdk"
import (
"fmt"

"github.com/casdoor/casdoor-go-sdk/casdoorsdk"
)

func GetUsers() []*casdoorsdk.User {
if adapter != nil {
Expand Down Expand Up @@ -61,7 +65,8 @@ func GetOnlineUserCount() int {
} else {
count, err := casdoorsdk.GetUserCount("1")
if err != nil {
panic(err)
fmt.Printf("GetOnlineUserCount() error, %s\n", err.Error())
return -1
}

return count
Expand Down

0 comments on commit 2c477f2

Please sign in to comment.