Fix possible null reference

This commit is contained in:
Jack251970 2024-11-27 21:21:42 +08:00
parent b95bbb3e6a
commit c474b304f5

View file

@ -51,6 +51,11 @@ namespace Flow.Launcher.Storage
private static int GenerateQueryAndResultHashCode(Query query, Result result)
{
if (query == null)
{
return GenerateResultHashCode(result);
}
int hashcode = GenerateStaticHashCode(query.ActionKeyword);
hashcode = GenerateStaticHashCode(query.Search, hashcode);
hashcode = GenerateStaticHashCode(result.Title, hashcode);
@ -101,4 +106,4 @@ namespace Flow.Launcher.Storage
return selectedCount;
}
}
}
}