throw an exception on empty resources when tree is queried