Skip to content

Commit 8b3d52e

Browse files
heliocastrotsteenbe
authored andcommitted
fix(cli): Check valid context
Signed-off-by: Helio Chissini de Castro <heliocastro@gmail.com>
1 parent b6af5e6 commit 8b3d52e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/orthw/utils/cmdgroups.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@
3434
def command_group(ctx: click.Context, debug: bool, docker: bool, logfile: str) -> None:
3535
if debug:
3636
logging.setLevel(stdlogger.DEBUG)
37-
ctx.obj["debug"] = True
37+
if ctx:
38+
ctx.obj["debug"] = True
3839
# Set the operations to run with configured container
39-
if docker:
40+
if docker and ctx:
4041
ctx.obj["docker"] = True
4142
if logfile:
4243
filehandler = stdlogger.FileHandler(

0 commit comments

Comments
 (0)