fix: Add null check for regex capture group and non-null assertion for type safety.
This commit is contained in:
@@ -18,7 +18,7 @@ export class ModerationService {
|
||||
|
||||
// Extract number from case ID (e.g., "CASE-0042" -> 42)
|
||||
const match = latestCase.caseId.match(/CASE-(\d+)/);
|
||||
if (!match) {
|
||||
if (!match || !match[1]) {
|
||||
return "CASE-0001";
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ export function getCasesListEmbed(
|
||||
if (!casesByType[c.type]) {
|
||||
casesByType[c.type] = [];
|
||||
}
|
||||
casesByType[c.type].push(c);
|
||||
casesByType[c.type]!.push(c);
|
||||
}
|
||||
|
||||
// Add fields for each type
|
||||
|
||||
Reference in New Issue
Block a user