Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: handle undefined classification config in masking policy UI (#18964)

Danny Xue4f16253d13a
diff --git a/frontend/src/components/SensitiveData/components/utils.ts b/frontend/src/components/SensitiveData/components/utils.ts
index a79fb6ed2d..246db6bb28 100644
--- a/frontend/src/components/SensitiveData/components/utils.ts
+++ b/frontend/src/components/SensitiveData/components/utils.ts
@@ -10,9 +10,14 @@ import { CEL_ATTRIBUTE_RESOURCE_PROJECT_ID } from "@/utils/cel-attributes";
export const getClassificationLevelOptions = () => {
const settingStore = useSettingV1Store();
- return settingStore.classification[0].levels.map<
- ResourceSelectOption<unknown>
- >((level) => ({
+ if (settingStore.classification.length === 0) {
+ return [];
+ }
+ const config = settingStore.classification[0];
+ if (!config?.levels) {
+ return [];
+ }
+ return config.levels.map<ResourceSelectOption<unknown>>((level) => ({
label: level.title,
value: level.id,
}));