Skip to content

Commit

Permalink
Check g.x_arg exists before working on it (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
skairunner authored Mar 11, 2024
1 parent 9c0adac commit 7e8032c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flask_migrate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_config(self, directory=None, x_arg=None, opts=None):
setattr(config.cmd_opts, opt, True)
if not hasattr(config.cmd_opts, 'x'):
setattr(config.cmd_opts, 'x', [])
for x in g.x_arg:
for x in getattr(g, 'x_arg', []):
config.cmd_opts.x.append(x)
if x_arg is not None:
if isinstance(x_arg, list) or isinstance(x_arg, tuple):
Expand Down

0 comments on commit 7e8032c

Please # to comment.