Add panic checks
This commit is contained in:
@@ -121,6 +121,9 @@ func (c *configurator) acceptEstablishedRelatedTraffic(ctx context.Context, remo
|
|||||||
|
|
||||||
func (c *configurator) acceptOutputTrafficToVPN(ctx context.Context,
|
func (c *configurator) acceptOutputTrafficToVPN(ctx context.Context,
|
||||||
defaultInterface string, connection models.OpenVPNConnection, remove bool) error {
|
defaultInterface string, connection models.OpenVPNConnection, remove bool) error {
|
||||||
|
if connection.IP == nil {
|
||||||
|
panic("PLEASE CREATE AN ISSUE with this log: https://github.com/qdm12/gluetun/issues")
|
||||||
|
}
|
||||||
return c.runIptablesInstruction(ctx,
|
return c.runIptablesInstruction(ctx,
|
||||||
fmt.Sprintf("%s OUTPUT -d %s -o %s -p %s -m %s --dport %d -j ACCEPT",
|
fmt.Sprintf("%s OUTPUT -d %s -o %s -p %s -m %s --dport %d -j ACCEPT",
|
||||||
appendOrDelete(remove), connection.IP, defaultInterface, connection.Protocol, connection.Protocol, connection.Port))
|
appendOrDelete(remove), connection.IP, defaultInterface, connection.Protocol, connection.Protocol, connection.Port))
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ func (l *looper) Run(ctx context.Context, wg *sync.WaitGroup) {
|
|||||||
l.cancel()
|
l.cancel()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if connection.IP == nil {
|
||||||
|
panic("PLEASE CREATE AN ISSUE with this log: https://github.com/qdm12/gluetun/issues")
|
||||||
|
}
|
||||||
lines := providerConf.BuildConf(connection, l.username, settings)
|
lines := providerConf.BuildConf(connection, l.username, settings)
|
||||||
|
|
||||||
if err := writeOpenvpnConf(lines, l.openFile); err != nil {
|
if err := writeOpenvpnConf(lines, l.openFile); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user