The bug with stats makes sense – the question is what behavior would be better for clients:
1) leave the _fieldStatsInfo Map empty
2) populate _fieldStatsInfo with all of the fields that were returned as keys, but null for hte values
3) populate _fieldStatsInfo with "empty" FieldStatsInfo objects (so all the accessors – ie: FieldStatsInfo.getCount() – return null)
#2 & #3 being alternate methods for conveying to clients which fields they would have gotten stats for if the result set hadn't been empty.
any of these approaches is relatively trivial to implement, it's just a question of which will be the best for clients.
I don't really understand the change to extractFacetInfo in the patch. even with an empty result set, the facet_query NamedList will never contain a null value – they will all be zeros. ... can someone post a stack trace (and explanation of what the request looked like) where the current code caused a problem?