Skip to content

Commit

Permalink
fix: validate group name
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Kuzila <[email protected]>
  • Loading branch information
Dominik Kužila authored and Dominik-Kuzila committed Oct 27, 2024
1 parent f493e36 commit c49b1ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Christian Kraus <[email protected]>
- Christoph Wurst <[email protected]>
- Daniel Kesselberg <[email protected]>
- Dominik Kuzila <[email protected]>
- Gary Kim <[email protected]>
- Georg Ehrke <[email protected]>
- Greta Doci <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions src/store/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ const actions = {
* @param {string} groupName the name of the group
*/
addGroup(context, groupName) {
if (!groupName || groupName.trim() === '') {
throw new Error('Group name cannot be empty')

Check warning on line 188 in src/store/groups.js

View check run for this annotation

Codecov / codecov/patch

src/store/groups.js#L188

Added line #L188 was not covered by tests
}
context.commit('addGroup', groupName)
},
}
Expand Down

0 comments on commit c49b1ac

Please sign in to comment.