Selaa lähdekoodia

Merge pull request #32 from lin5/master

读写数据库报空
tanghai 8 vuotta sitten
vanhempi
commit
eed452aa1e

+ 2 - 2
Server/Hotfix/Handler/DBSaveBatchRequestHandler.cs

@@ -13,7 +13,7 @@ namespace Hotfix
 			{
 				DBCacheComponent dbCacheComponent = Game.Scene.GetComponent<DBCacheComponent>();
 
-				if (message.CollectionName == "")
+				if (string.IsNullOrEmpty(message.CollectionName))
 				{
 					message.CollectionName = message.Disposers[0].GetType().Name;
 				}
@@ -36,4 +36,4 @@ namespace Hotfix
 			}
 		}
 	}
-}
+}

+ 3 - 3
Server/Model/Component/DBCacheComponent.cs

@@ -37,7 +37,7 @@ namespace Model
 
 			this.AddToCache(disposer, collectionName);
 
-			if (collectionName == "")
+			if (string.IsNullOrEmpty(collectionName))
 			{
 				collectionName = disposer.GetType().Name;
 			}
@@ -57,7 +57,7 @@ namespace Model
 
 		public void AddToCache(Disposer disposer, string collectionName = "")
 		{
-			if (collectionName == "")
+			if (string.IsNullOrEmpty(collectionName))
 			{
 				collectionName = disposer.GetType().Name;
 			}
@@ -147,4 +147,4 @@ namespace Model
 			return tcs.Task;
 		}
 	}
-}
+}