Commit 97c45335 authored by generalredneck's avatar generalredneck

If views_natural_sort is enabled and there are 0 nodes availiable, a division...

If views_natural_sort is enabled and there are 0 nodes availiable, a division by 0 error occurs. Fixed.
parent 57972f2b
......@@ -52,6 +52,11 @@ function views_natural_sort_rebuild_index(&$context) {
'SELECT COUNT(nid) FROM {node} WHERE nid <= :max',
array('max' => $sandbox['max'])
)->fetchField();
if ($sandbox['total'] == 0) {
$context['finished'] = 1;
return;
}
$sandbox['current'] = 0;
$context['results']['nodes'] = 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment