Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix null pointer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zu1k committed Sep 6, 2020
1 parent 49b1c69 commit 87f1fff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/zu1k/proxypool/pkg/provider"
)

const version = "v0.3.7"
const version = "v0.3.8"

var router *gin.Engine

Expand Down
8 changes: 7 additions & 1 deletion pkg/proxy/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import (
)

func SS2SSR(ss *Shadowsocks) (ssr *ShadowsocksR, err error) {
if ss == nil {
return nil, errors.New("ss is nil")
}
if !tool.CheckInList(SSRCipherList, ss.Cipher) {
return nil, errors.New("cipher not support")
}
base := ssr.Base
base := ss.Base
base.Type = "ssr"
return &ShadowsocksR{
Base: base,
Expand All @@ -23,6 +26,9 @@ func SS2SSR(ss *Shadowsocks) (ssr *ShadowsocksR, err error) {
}

func SSR2SS(ssr *ShadowsocksR) (ss *Shadowsocks, err error) {
if ssr == nil {
return nil, errors.New("ssr is nil")
}
if !tool.CheckInList(SSCipherList, ssr.Cipher) {
return nil, errors.New("cipher not support")
}
Expand Down

0 comments on commit 87f1fff

Please sign in to comment.