Making sure context is initialised before using it

Now checkong context is not nil before setting panicked = true
This commit is contained in:
Simon Aquino
2014-08-16 14:33:36 +00:00
parent 0c09bdedaa
commit 6ff601f4a2

View File

@@ -59,7 +59,9 @@ func Fatal(err error) {
if err == commander.ErrFlagError || err == commander.ErrCommandError {
returnCode = 2
}
context.panicked = true
if context != nil {
context.panicked = true
}
panic(&FatalError{ReturnCode: returnCode, Message: err.Error()})
}