Skip to content

Commit 007f96c

Browse files
authored
Merge pull request #1141 from iceljc/master
Fix potential null reference
2 parents 21a7c9b + 690590f commit 007f96c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Plugins/BotSharp.Plugin.Qdrant/QdrantDb.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,13 @@ public async Task<bool> Upsert(string collectionName, Guid id, float[] vector, s
230230
{
231231
foreach (var item in payload)
232232
{
233+
if (item.Value == null || item.Key.IsEqualTo(KnowledgePayloadName.Text))
234+
{
235+
continue;
236+
}
237+
233238
var value = item.Value.DataValue?.ConvertToString();
234-
if (value == null || item.Key.IsEqualTo(KnowledgePayloadName.Text))
239+
if (string.IsNullOrEmpty(value))
235240
{
236241
continue;
237242
}

0 commit comments

Comments
 (0)