From 131ff81c0d8d8b9a189829820fb8ca6aedc8168b Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Tue, 13 Sep 2011 20:38:34 +0000 Subject: [PATCH] Don't reschedule a canceled timer git-svn-id: http://google-refine.googlecode.com/svn/trunk@2236 7d457c2a-affb-35e4-300a-418c747d4874 --- main/src/com/google/refine/RefineServlet.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main/src/com/google/refine/RefineServlet.java b/main/src/com/google/refine/RefineServlet.java index 8b033f9ca..11eef6734 100644 --- a/main/src/com/google/refine/RefineServlet.java +++ b/main/src/com/google/refine/RefineServlet.java @@ -90,9 +90,11 @@ public class RefineServlet extends Butterfly { try { ProjectManager.singleton.save(false); // quick, potentially incomplete save } finally { - _timer.schedule(new AutoSaveTimerTask(), s_autoSavePeriod); - // we don't use scheduleAtFixedRate because that might result in - // bunched up events when the computer is put in sleep mode + if (_timer != null) { + _timer.schedule(new AutoSaveTimerTask(), s_autoSavePeriod); + // we don't use scheduleAtFixedRate because that might result in + // bunched up events when the computer is put in sleep mode + } } } }