Skip to content

Commit 23b131d

Browse files
committed
- Fix for Cache Where clauses adding unnecessary SQL code when empty.
- (Chinese Client Fix)
1 parent 2b0b63a commit 23b131d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

xivModdingFramework/Cache/XivCache.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,12 @@ public WhereClause()
909909
/// <returns></returns>
910910
public string GetSql(bool includeWhere = true, bool skipJoin = true)
911911
{
912+
// No clause if no valid value.
913+
if((Inner == null || Inner.Count == 0) && (Column == null || Column == ""))
914+
{
915+
return "";
916+
}
917+
912918
var result = "";
913919
if(includeWhere)
914920
{
@@ -987,7 +993,10 @@ public void AddParameters(SQLiteCommand cmd)
987993
}
988994
else
989995
{
990-
cmd.Parameters.AddWithValue(Column, Value);
996+
if (Column != null && Column != "")
997+
{
998+
cmd.Parameters.AddWithValue(Column, Value);
999+
}
9911000
}
9921001
}
9931002
}

0 commit comments

Comments
 (0)