diff --git a/apps/ops/models/command.py b/apps/ops/models/command.py index 408c72915..12ffdddd1 100644 --- a/apps/ops/models/command.py +++ b/apps/ops/models/command.py @@ -78,7 +78,7 @@ class CommandExecution(OrgModelMixin): runner = CommandRunner(self.inventory) try: host = self.hosts.first() - if host.is_windows(): + if host and host.is_windows(): shell = 'win_shell' else: shell = 'shell'