diff --git a/core/vmap.h b/core/vmap.h index 35548dc5cc9..8b9961fe0e0 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -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); }