Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix null values for unknown pki dashboard fields

Carlos Monastyrski58bc29ddeb76
diff --git a/backend/src/services/certificate/certificate-dal.ts b/backend/src/services/certificate/certificate-dal.ts
index 010248d9ae..754d6346ed 100644
--- a/backend/src/services/certificate/certificate-dal.ts
+++ b/backend/src/services/certificate/certificate-dal.ts
@@ -633,7 +633,7 @@ export const certificateDALFactory = (db: TDbClient) => {
}
interface LabelCount {
- label: string;
+ label: string | null;
count: string;
}
@@ -771,11 +771,11 @@ export const certificateDALFactory = (db: TDbClient) => {
expiredNotRenewed: totals.expiredNotRenewed,
distributions: {
byEnrollmentMethod: (byEnrollmentMethod as unknown as LabelCount[]).map((r) => ({
- label: r.label,
+ label: r.label || "Unknown",
count: Number(r.count)
})),
byAlgorithm: (byAlgorithm as unknown as LabelCount[]).map((r) => ({
- label: r.label,
+ label: r.label || "Unknown",
count: Number(r.count)
})),
byCA: (byCA as unknown as LabelCountWithId[]).map((r) => ({