1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00

🔧 Disallow adding empty conditions

This commit is contained in:
Stefano Pigozzi 2021-04-30 15:53:01 +02:00
parent 12f8058da1
commit 1daa35f9d7
Signed by untrusted user who does not match committer: steffo
GPG key ID: 6965406171929D01
2 changed files with 12 additions and 0 deletions

View file

@ -37,6 +37,12 @@ export default function BoxConditionHashtag({ ...props }) {
"type": 0, "type": 0,
"content": hashtag "content": hashtag
} }
if(hashtag === "") {
console.debug("Refusing to append ", newCond, " to the Conditions list, as it is empty.")
return
}
let duplicate = null; let duplicate = null;
for(const oldCond of conditions) { for(const oldCond of conditions) {
if(newCond.type === oldCond.type && newCond.content === oldCond.content) { if(newCond.type === oldCond.type && newCond.content === oldCond.content) {

View file

@ -36,6 +36,12 @@ export default function BoxConditionUser({ ...props }) {
"type": 3, "type": 3,
"content": user "content": user
} }
if(user === "") {
console.debug("Refusing to append ", newCond, " to the Conditions list, as it is empty.")
return
}
let duplicate = null; let duplicate = null;
for(const oldCond of conditions) { for(const oldCond of conditions) {
if(newCond.type === oldCond.type && newCond.content === oldCond.content) { if(newCond.type === oldCond.type && newCond.content === oldCond.content) {