Commit 6346523c authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Fix nil deref

parent a8147d2e
......@@ -134,7 +134,7 @@ func (cm *CredentialManager) NewSession(qr *Qr, handler Handler) {
func (session *session) fail(err *SessionError) {
session.transport.Delete()
err.Err = errors.Wrap(err.Err, 0)
if !session.downloaded.Empty() {
if session.downloaded != nil && !session.downloaded.Empty() {
session.credManager.handler.UpdateConfigurationStore(session.downloaded)
}
session.Handler.Failure(session.Action, err)
......@@ -142,7 +142,7 @@ func (session *session) fail(err *SessionError) {
func (session *session) cancel() {
session.transport.Delete()
if !session.downloaded.Empty() {
if session.downloaded != nil && !session.downloaded.Empty() {
session.credManager.handler.UpdateConfigurationStore(session.downloaded)
}
session.Handler.Cancelled(session.Action)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment