--- a/ImageView.cpp
+++ b/ImageView.cpp
@@ -381,6 +381,7 @@
 
 int CImageView::GetPolygonSize(int idx)
 {
+  if (idx<0) return 0;
   switch(m_maptype)
   {
   case MT_WALLPOLYLIST: