summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/templates/vmap.h3
1 files changed, 3 insertions, 0 deletions
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);
}