From 7f55a7c6cef156e553866d0012464e4697cb1849 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 20 六月 2025 16:27:04 +0800
Subject: [PATCH] 1.联调,优化。

---
 SourceCode/Bond/Servo/CAttributeVector.cpp |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CAttributeVector.cpp b/SourceCode/Bond/Servo/CAttributeVector.cpp
index 733c629..79e1776 100644
--- a/SourceCode/Bond/Servo/CAttributeVector.cpp
+++ b/SourceCode/Bond/Servo/CAttributeVector.cpp
@@ -19,9 +19,18 @@
 
 	void CAttributeVector::addAttribute(CAttribute* pAttribute, BOOL bReplace/* = FALSE*/)
 	{
+		if (!pAttribute) { 
+			return;
+		}
+
+		const std::string& name = pAttribute->getName();
+		if (name.empty()) { 
+			return;
+		}
+
 		if (bReplace) {
 			for (auto it = m_attributes.begin(); it != m_attributes.end(); ) {
-				if ((*it)->getName().compare(pAttribute->getName()) == 0) {
+				if (name.compare((*it)->getName()) == 0) {
 					delete (*it);
 					it = m_attributes.erase(it);
 				}

--
Gitblit v1.9.3