Skip to content

Commit cbc4a85

Browse files
committed
nilaway: ipn/proxies, ipn/warp
1 parent e86a307 commit cbc4a85

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

intra/ipn/proxies.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ func (px *proxifier) registerAmnezia(existingStateJson []byte) (stateJson []byte
932932
}
933933

934934
if id == nil {
935-
err = errNilAmzId
935+
return nil, errNilAmzId
936936
}
937937

938938
if err != nil {
@@ -979,7 +979,7 @@ func (px *proxifier) RegisterProton(existingStateJson []byte) (stateJson []byte,
979979
p, err = px.extc.MakeProtonWg(nostore)
980980
}
981981
if p == nil {
982-
err = errNilProtonCfg
982+
return nil, errNilProtonCfg
983983
}
984984
if err != nil {
985985
log.E("proxy: proton: make (restore? %t) failed: %v", restore, err)

intra/ipn/warp/proton.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,8 @@ func (a *ProtonClient) rereg(force bool) error {
11451145
}
11461146

11471147
now := time.Now().Unix()
1148-
fresh := a.config.CertRefreshTime-now > 0
1148+
// redundant nilcheck for nilaway
1149+
fresh := a.config != nil && a.config.CertRefreshTime-now > 0
11491150

11501151
log.I("proton: re-reg %s (exp? %t, force? %t)",
11511152
a.cert.SerialNumber, !fresh, force)

0 commit comments

Comments
 (0)