ezsystems/ezpublish-kernel — pull request #349 by pspanja (2013-05-06 16:00:54+00:00)
Title: EZP-20812: Search with offset can ends up in an exception if there is no result

This PR fixes issue https://jira.ez.no/browse/EZP-20812

Check if offset points to existing results was missing, therefore offsetting too far would result in empty array being passed to the ```in``` expression.

In turn this resulted in ```ezcQueryInvalidParameterException``` being thrown, converted to the ```RuntimeException``` and crashing the application.

Added condition check that offset does not exceed the total number of results + test.