Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Stop location being referenced before assignment #2809

Merged
merged 1 commit into from
Jan 19, 2021
Merged

Stop location being referenced before assignment #2809

merged 1 commit into from
Jan 19, 2021

Conversation

PureTryOut
Copy link
Contributor

Description

In cases where the location can't be determined by the device or a
config setting, the location variable wouldn't exist but it would still
be referenced.
This makes sure the variable always exists, but if not changed is equal
to None

How to test

Run Mycroft on a device with no location set in config or accessible via GPS or anything. Notice in the voice log that location is being referenced before assignment.
Then run Mycroft with this PR and notice the error is gone.

Contributor license agreement signed?

CLA [x]

In cases where the location can't be determined by the device or a
config setting, the location variable wouldn't exist but it would still
be referenced.
This makes sure the variable always exists, but if not changed is equal
to None
@devops-mycroft devops-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Jan 19, 2021
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@forslund forslund added the Type: Bug - quick Bug fixes that are quick to review and the implications of the change are clear and contained. label Jan 19, 2021
Copy link
Collaborator

@forslund forslund left a comment

Choose a reason for hiding this comment

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

Nice find! Merging

@forslund forslund merged commit 1a179da into MycroftAI:dev Jan 19, 2021
@PureTryOut PureTryOut deleted the location-referenced-before-assignment-2 branch January 19, 2021 20:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) Type: Bug - quick Bug fixes that are quick to review and the implications of the change are clear and contained.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants