Created attachment 187895 [details] The announced demo XIndexAccess containers can well be empty. The .Count property then is 0. The result of a .findAll() with XSearchable is one of the cases where a result of type XIndexAccess is specified, but NO such result is returned if nothing was found. Instead of setting .Count to 0, in this case the NULL object is returned. It may factually be impossible to fix the bug because old running code would be broken this way. However, the API documentation should give a related hint, and list the cases where a NULL ob ject will be returned, while a XIndexAccess object should be expected. Thare is a demonstrating example attched.
https://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/cellsuno.cxx?r=3e7ff2a9&mo=189177&fi=3757#3757 introduced in the initial import. It looks reasonable to throw an error when the initial check (pDocShell && xDesc.is()) fails, and if it passes, it seems possible to create an empty ScRangeList right away, and create the returned ScCellRangesObj with it unconditionally before return. The easyhack needs a unit test.