diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-08-13 17:32:58 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-08-13 17:32:58 +0100 |
commit | 6726163fef48df4c6ec3dde81d5f68d1d52c8e4d (patch) | |
tree | 6521375055b03c8bba9ecac54544506b90b178fa | |
parent | f6e8301932ce1bb1c059826ded8807e7f8cdfc79 (diff) | |
download | supple-6726163fef48df4c6ec3dde81d5f68d1d52c8e4d.tar.gz |
TRACK: Cope with negative depths and nil tracks
-rw-r--r-- | lib/supple/track.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/supple/track.lua b/lib/supple/track.lua index c652281..b22156f 100644 --- a/lib/supple/track.lua +++ b/lib/supple/track.lua @@ -27,7 +27,9 @@ end local function leave(...) if depth then - depth = depth - 1 + if depth > 0 then + depth = depth - 1 + end record("<<<", ...) end end @@ -37,6 +39,9 @@ local function start_tracking() end local function stop_tracking() + if track == nil then + return "***NO TRACKING DATA***" + end local ret = {} for i = 1, #track do local ent = track[i] |