summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/template.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/template.cpp b/src/template.cpp
index ec8554b..cec2e3c 100644
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -1319,7 +1319,15 @@ class FilterDivisibleBy
}
if (v.type()==TemplateVariant::Integer && n.type()==TemplateVariant::Integer)
{
- return TemplateVariant((v.toInt()%n.toInt())==0);
+ int ni = n.toInt();
+ if (ni>0)
+ {
+ return TemplateVariant((v.toInt()%ni)==0);
+ }
+ else
+ {
+ return TemplateVariant(FALSE);
+ }
}
else
{