From: hjhun <36876573+hjhun@users.noreply.github.com> Date: Tue, 2 Jul 2019 08:29:03 +0000 (+0900) Subject: Add an exception (#915) X-Git-Tag: submit/tizen_5.0/20190703.005228~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43e945d4a6712c2078123e1c5ee11a2246e234dc;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add an exception (#915) If the interval is less than or equal to zero, or greater than integer maximum value, ArgumentException is occurred. Signed-off-by: Hwankyu Jhun --- diff --git a/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs b/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs index 6a72aee65..fb108eadf 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs @@ -178,7 +178,11 @@ namespace Tizen.Applications protected virtual void OnLowMemory(LowMemoryEventArgs e) { LowMemory?.Invoke(this, e); - sTimer = new Timer(new Random().Next(10 * 1000)); + double interval = new Random().Next(10 * 1000); + if (interval <= 0) + interval = 10 * 1000; + + sTimer = new Timer(interval); sTimer.Elapsed += OnTimedEvent; sTimer.AutoReset = false; sTimer.Enabled = true;