From 622eecf707870330ae5713d9c2a36f6664e8d8e3 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Tue, 17 Oct 2023 11:23:44 +0530 Subject: [PATCH] Check if user provided webURL before trying to access it (#4510) The check should have already happened in the CLI layer. And we cannot do the check here this function is also shared with export which might not have a filter. Follow up to https://github.com/alcionai/corso/pull/4496 --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup #### Issue(s) * # #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/cli/utils/groups.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/utils/groups.go b/src/cli/utils/groups.go index 9ded3c9ed..078c379cc 100644 --- a/src/cli/utils/groups.go +++ b/src/cli/utils/groups.go @@ -272,11 +272,11 @@ func FilterGroupsRestoreInfoSelectors( ) { var site string + // It is possible that neither exists as this filter is only + // mandatory for restore and not for export. if len(opts.SiteID) > 0 { site = opts.SiteID[0] - } else { - // using else instead of else if so that it would have a hard - // fail in case we somehow miss checking this earlier + } else if len(opts.WebURL) > 0 { site = opts.WebURL[0] }