Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyaowong committed Nov 14, 2020
1 parent 6f93518 commit c316532
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion botoy/decorators/_startswith.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def inner(ctx):
content = refine_ctx.Content
else:
content = ctx.Content
if content.startswith(string):
# 这里的content按理永远不可能为None,但就是碰到了这种情况,startswith用得比较多
# 所以先在这里增加一步判断
if content is not None and content.startswith(string):
return func(ctx)
return None

Expand Down

0 comments on commit c316532

Please sign in to comment.