Bugfix: Repeated channel opening attempts failed because err was shadowed

This commit is contained in:
Sarah Jamie Lewis 2018-01-16 12:13:46 -05:00
parent 9191b7530e
commit 71685b9c3a
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,6 @@ func (rc *Connection) handleChannelOpening(channel *channels.Channel, response [
}
func (rc *Connection) buildChannel(handler channels.Handler, openChannelFunc func(handler channels.Handler) (*channels.Channel, error)) (*channels.Channel, error) {
err := rc.am.Authorized(handler.RequiresAuthentication())
if err == nil {
channel, err := openChannelFunc(handler)
@ -240,6 +239,7 @@ func (rc *Connection) buildChannel(handler channels.Handler, openChannelFunc fun
}
return channel, nil
}
return nil, err
}
return nil, err
}