From 311a17193daa303d17fe182fdba8edaf7a620ab4 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 5 Mar 2009 21:51:58 +0000 Subject: Fixes a division by zero error causing crashes on multi-table CSV and XML exports (Issue #184) --- Source/TableDump.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/TableDump.m b/Source/TableDump.m index f7fd3a80..fb0504a8 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -1067,7 +1067,7 @@ for ( i = startingRow ; i < totalRows ; i++ ) { // Update the progress bar - [singleProgressBar setDoubleValue:((i+1)*100/totalRows)]; + if (totalRows) [singleProgressBar setDoubleValue:((i+1)*100/totalRows)]; if ((int)[singleProgressBar doubleValue] > lastProgressValue) { lastProgressValue = (int)[singleProgressBar doubleValue]; [singleProgressBar displayIfNeeded]; @@ -1421,7 +1421,7 @@ for ( i = 1 ; i < totalRows ; i++ ) { // Update the progress bar - [singleProgressBar setDoubleValue:((i+1)*100/totalRows)]; + if (totalRows) [singleProgressBar setDoubleValue:((i+1)*100/totalRows)]; if ((int)[singleProgressBar doubleValue] > lastProgressValue) { lastProgressValue = (int)[singleProgressBar doubleValue]; [singleProgressBar displayIfNeeded]; -- cgit v1.2.3