Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: Fixed an issue that caused the page to crash when a knowledge base variable was selected. #10427 (#11197)

balibabue7f7c09b0b58
diff --git a/web/src/components/ragflow-avatar.tsx b/web/src/components/ragflow-avatar.tsx
index e84a01b34c..e3bfc5700e 100644
--- a/web/src/components/ragflow-avatar.tsx
+++ b/web/src/components/ragflow-avatar.tsx
@@ -11,6 +11,8 @@ const PREDEFINED_COLORS = [
];
const getStringHash = (str: string): number => {
+ if (typeof str !== 'string') return 0;
+
const normalized = str.trim().toLowerCase();
let hash = 104729;
const seed = 0x9747b28c;
@@ -41,8 +43,8 @@ export const RAGFlowAvatar = memo(
>(({ name, avatar, isPerson = false, className, ...props }, ref) => {
// Generate initial letter logic
const getInitials = (name?: string) => {
- if (!name) return '';
- const parts = name.trim().split(/\s+/);
+ if (typeof name !== 'string' || !name) return '';
+ const parts = name?.trim().split(/\s+/);
if (parts.length === 1) {
return parts[0][0].toUpperCase();
}