diff --git a/core/templates/vmap.h b/core/templates/vmap.h index 013c4e4262..37622258db 100644 --- a/core/templates/vmap.h +++ b/core/templates/vmap.h @@ -142,6 +142,9 @@ public: } int find_nearest(const T &p_val) const { + if (_cowdata.is_empty()) { + return -1; + } bool exact; return _find(p_val, exact); }