mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: check for empty names before pushing edit
This commit is contained in:
parent
852a8a8f00
commit
6e01238364
2 changed files with 4 additions and 0 deletions
|
|
@ -25,6 +25,8 @@
|
||||||
err = [];
|
err = [];
|
||||||
success = false;
|
success = false;
|
||||||
|
|
||||||
|
if (!data.name) err.push("Group name cannot be empty.")
|
||||||
|
|
||||||
if (data.color && !/^#?[A-Fa-f0-9]{6}$/.test(input.color)) {
|
if (data.color && !/^#?[A-Fa-f0-9]{6}$/.test(input.color)) {
|
||||||
err.push(`"${data.color}" is not a valid color, the color must be a 6-digit hex code. (example: #ff0000)`);
|
err.push(`"${data.color}" is not a valid color, the color must be a 6-digit hex code. (example: #ff0000)`);
|
||||||
} else if (data.color) {
|
} else if (data.color) {
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@
|
||||||
let data = input;
|
let data = input;
|
||||||
err = [];
|
err = [];
|
||||||
|
|
||||||
|
if (!data.name) err.push("Member name cannot be empty.")
|
||||||
|
|
||||||
if (data.color && !/^#?[A-Fa-f0-9]{6}$/.test(input.color)) {
|
if (data.color && !/^#?[A-Fa-f0-9]{6}$/.test(input.color)) {
|
||||||
err.push(`"${data.color}" is not a valid color, the color must be a 6-digit hex code. (example: #ff0000)`);
|
err.push(`"${data.color}" is not a valid color, the color must be a 6-digit hex code. (example: #ff0000)`);
|
||||||
} else if (data.color) {
|
} else if (data.color) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue