Skip to content

fix: Another nil index along a REST response error handling path #2220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/SmartThings/sonos/src/sonos_driver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function SonosDriver:check_auth(info_or_device)
local headers = SonosApi.make_headers(api_key, maybe_token and maybe_token.accessToken)
local response, response_err = SonosApi.RestApi.get_groups_info(rest_url, household_id, headers)

if response._objectType == "globalError" then
if response and response._objectType == "globalError" then
unauthorized = (response.errorCode == "ERROR_NOT_AUTHORIZED")
if not unauthorized then
return nil, string.format("Unexpected error body: %s", st_utils.stringify_table(response))
Expand Down
Loading