schotime/PetaPoco — pull request #5 by clevinas (2012-02-12 10:40:20+00:00)
Title: ToArray() does not return null as assumed

ToArray() extension method on IEnumerable<> with deferred execution doesn't do what it's assumed here. If the object evaluates to null (ie. no parameters), it creates an object[0] containing a null object, instead of returning null as expected. Then, the line "if (args != null && args.Length > 0)" in FormatCommand() fails. There could potentially be other errors of ToArray() in other places (QueryColumns ?).