提交 0d01ae98 编写于 作者: C CyrusNajmabadi

Be resilient to null-paths/names for Documents/Projects in SqlitePersistence layer.

上级 bedaa5e6
......@@ -202,6 +202,11 @@ string GetDocumentIdString(Document document)
void AddIfUnknownId(string value, HashSet<string> stringsToAdd)
{
if (value == null)
{
return;
}
if (!_stringToIdMap.TryGetValue(value, out var id))
{
stringsToAdd.Add(value);
......
......@@ -34,6 +34,11 @@ private void FetchStringTable(SqlConnection connection)
private int? TryGetStringId(SqlConnection connection, string value)
{
if (value == null)
{
return null;
}
// First see if we've cached the ID for this value locally. If so, just return
// what we already have.
if (_stringToIdMap.TryGetValue(value, out int existingId))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册