Check context arguments before comparison // Resolve #1000

This commit is contained in:
Ivan Kravets
2017-07-27 15:50:54 +03:00
parent 954357bdd2
commit 9994ed8b5e

View File

@ -39,7 +39,7 @@ def in_silence(ctx=None):
assert ctx
ctx_args = ctx.args or []
conditions = [
ctx.args[0] == "upgrade", "--json-output" in ctx_args,
ctx_args and ctx.args[0] == "upgrade", "--json-output" in ctx_args,
"--version" in ctx_args
]
return ctx_args and any(conditions)