mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.35k stars 1.22k forks source link

Incorrect argument validation exception #2487

Closed OlegLevitsky closed 1 week ago

OlegLevitsky commented 1 month ago

Query.Contains checks the String.IsNullOrWhiteSpace instead of String.IsNullOrEmpty

https://github.com/mbdavid/LiteDB/blob/5a4696606b4fc58554f01d725f621bd3e553fd18/LiteDB/Client/Structures/Query.cs#L126

  1. It causes incorrect ArgumentNullExcpeption for a spaces sequence
  2. There is no reason to restrict the search by spaces, because the same LIKE query works correct