fix: add check
This commit is contained in:
parent
ed80eee3e1
commit
d949e4402c
|
@ -102,9 +102,16 @@ export class AbuseReportNotificationService implements OnApplicationShutdown {
|
||||||
.filter(x => x != null),
|
.filter(x => x != null),
|
||||||
);
|
);
|
||||||
|
|
||||||
recipientEMailAddresses.push(
|
const emailRe = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
|
||||||
...(this.meta.maintainerEmail ? [this.meta.maintainerEmail] : []),
|
|
||||||
);
|
if (
|
||||||
|
this.meta.maintainerEmail &&
|
||||||
|
emailRe.test(this.meta.maintainerEmail) &&
|
||||||
|
!recipientEMailAddresses.includes(this.meta.maintainerEmail)
|
||||||
|
) {
|
||||||
|
recipientEMailAddresses.push(this.meta.maintainerEmail);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (recipientEMailAddresses.length <= 0) {
|
if (recipientEMailAddresses.length <= 0) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue