Skip to content

Potential None#23187

Merged
pvizeli merged 1 commit into
home-assistant:devfrom
Swamp-Ig:empty-reference
Apr 18, 2019
Merged

Potential None#23187
pvizeli merged 1 commit into
home-assistant:devfrom
Swamp-Ig:empty-reference

Conversation

@Swamp-Ig
Copy link
Copy Markdown
Contributor

Description:

Minor bugfix. Line of code fixed has potential for target state to be None when state is being deleted and an exception would happen.

In this case it's not unreasonable to not pass the context because that will be a system event anyhow. This will be fixed anyhow as part of #22587 anyhow.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

@github-actions
Copy link
Copy Markdown

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (automation) you are listed as a codeowner for? Thanks!

@pvizeli pvizeli merged commit d9fb3c8 into home-assistant:dev Apr 18, 2019
@Swamp-Ig Swamp-Ig deleted the empty-reference branch April 18, 2019 13:42
'to_state': to_s,
},
}, context=to_s.context))
}, context=(to_s.context if to_s else None)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not set None to context. I have a open PR to fix similar issue, #21801

@balloob
Copy link
Copy Markdown
Member

balloob commented Apr 18, 2019

Filed an issue with the correct solution #23194

@balloob balloob mentioned this pull request May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants