@@ -459,7 +459,7 @@ func (c *Config) AsShareableFile() string {
459459
460460 s .WriteString ("[Peer]\n " )
461461 s .WriteString (fmt .Sprintf ("PublicKey = %s\n " , c .config .PrivateKey .PublicKey ().String ()))
462- if len ( c .presharedKey ) > 0 {
462+ if c .presharedKey != nil {
463463 s .WriteString (fmt .Sprintf ("PresharedKey = %s\n " , c .presharedKey .String ()))
464464 }
465465 s .WriteString ("AllowedIPs = 0.0.0.0/32\n " )
@@ -511,7 +511,7 @@ func CreateServerCommand(relayConfig Config, e2eeConfig Config, shell Shell, sim
511511 keys = append (keys , "WIRETAP_RELAY_PEER_PUBLICKEY" )
512512 vals = append (vals , relayConfig .GetPeerPublicKey (0 ))
513513
514- if len ( relayConfig .GetPresharedKey ()) > 0 {
514+ if relayConfig .presharedKey != nil {
515515 keys = append (keys , "WIRETAP_RELAY_PEER_PRESHAREDKEY" )
516516 vals = append (vals , relayConfig .GetPresharedKey ())
517517 }
@@ -615,7 +615,7 @@ func CreateServerFile(relayConfig Config, e2eeConfig Config, simple bool) string
615615 }
616616
617617 s .WriteString (fmt .Sprintf ("PublicKey = %s\n " , relayConfig .GetPeerPublicKey (0 )))
618- if len ( relayConfig .GetPresharedKey ()) > 0 {
618+ if relayConfig .presharedKey != nil {
619619 s .WriteString (fmt .Sprintf ("PresharedKey = %s\n " , relayConfig .GetPresharedKey ()))
620620 }
621621 if len (relayConfig .GetPeerEndpoint (0 )) > 0 {
0 commit comments