summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/custom/eAAC_Scripts/DonationGirl/donate.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/npc/custom/eAAC_Scripts/DonationGirl/donate.txt b/npc/custom/eAAC_Scripts/DonationGirl/donate.txt
index 99a2776f1..b22498289 100644
--- a/npc/custom/eAAC_Scripts/DonationGirl/donate.txt
+++ b/npc/custom/eAAC_Scripts/DonationGirl/donate.txt
@@ -21,6 +21,8 @@
//= with decimals.
//= 3.1 - Added quotes to some queries, fixed a variable and
//= removed a comment.
+//= 3.2 - Fixed a problem where eAthena would crash if a
+//= query returned NULL.
//===== Compatible With =====================================
//= eAthena - any version that contains the escape_sql
//= function (Stable 6299 OR Trunk 6262)
@@ -143,7 +145,7 @@ close;
L_STATS:
mes "[Donation Girl]";
-query_sql "SELECT SUM(amount) FROM `donate`", @total$;
+query_sql "SELECT IFNULL((SELECT SUM(amount) FROM `donate`),0)", @total$;
mes "Our fund is at a total of $"+@total$+"";
next;
menu "More info",L_INFO,"Make a claim",L_CHECK,"Statistics",L_STATS;