Skip to content

Commit b208642

Browse files
authored
Merge pull request #6875 from ellemouton/fixProfilePanic
cmd+docs: fix cap out of range error in profile command
2 parents 9f013f5 + 96021fe commit b208642

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/lncli/cmd_profile.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ func profileRemove(ctx *cli.Context) error {
199199
return fmt.Errorf("name argument missing")
200200
}
201201

202+
if len(f.Profiles) == 0 {
203+
return fmt.Errorf("there are no existing profiles")
204+
}
205+
202206
// Create a copy of all profiles but don't include the one to delete.
203207
newProfiles := make([]*profileEntry, 0, len(f.Profiles)-1)
204208
for _, p := range f.Profiles {

docs/release-notes/release-notes-0.16.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ minimum version needed to build the project.
5757
* [Fix](https://github.com/lightningnetwork/lnd/pull/6858) command line argument
5858
parsing for `lncli sendpayment`.
5959

60+
* [Fix](https://github.com/lightningnetwork/lnd/pull/6875) mapslice cap out of
61+
range error that occurs if the number of profiles is zero.
62+
6063
## Code Health
6164

6265
* [test: use `T.TempDir` to create temporary test

0 commit comments

Comments
 (0)