diff options
author | 2016-04-24 17:06:25 -0500 | |
---|---|---|
committer | 2016-04-24 17:06:25 -0500 | |
commit | 2028ec2917d72260fbe32bc84e01452169e1b626 (patch) | |
tree | 3f8a5f7ba4e45ad967ec75358be4f90efb9388cd /plugins/timer/init.lua | |
parent | 169b790b99cde031bff9e3440cb68aaefa0e1b3c (diff) |
plugins/timer: don't fail if file is corrupt (nw)
Diffstat (limited to 'plugins/timer/init.lua')
-rw-r--r-- | plugins/timer/init.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/timer/init.lua b/plugins/timer/init.lua index 3a96f019f0d..6600432634f 100644 --- a/plugins/timer/init.lua +++ b/plugins/timer/init.lua @@ -55,6 +55,12 @@ function timer.startplugin() play_count = file:read("n") file:close() end + if not play_count then + play_count = 0 + end + if not total_time then + total_time = 0 + end start_time = os.time() play_count = play_count + 1 end) |