(cherry picked from commit 3057b19daa3a9c2e6fbd1da97822e8c1f795dcdc)
@@ -141,6 +141,9 @@ public:
}
int find_nearest(const T &p_val) const {
+ if (_cowdata.empty()) {
+ return -1;
+ }
bool exact;
return _find(p_val, exact);