mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Making sure context is initialised before using it
Now checkong context is not nil before setting panicked = true
This commit is contained in:
+3
-1
@@ -59,7 +59,9 @@ func Fatal(err error) {
|
|||||||
if err == commander.ErrFlagError || err == commander.ErrCommandError {
|
if err == commander.ErrFlagError || err == commander.ErrCommandError {
|
||||||
returnCode = 2
|
returnCode = 2
|
||||||
}
|
}
|
||||||
context.panicked = true
|
if context != nil {
|
||||||
|
context.panicked = true
|
||||||
|
}
|
||||||
panic(&FatalError{ReturnCode: returnCode, Message: err.Error()})
|
panic(&FatalError{ReturnCode: returnCode, Message: err.Error()})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user