Commit cb1f1a61cedf3da332ebbc02a61e371a8b04b4dd
check that item is still in cache before destroying
Matt McKegg committed on 6/28/2017, 9:16:46 AMParent: 4ff3dd24fadc8bffcd79936dec7a644eb40ef22d
Files changed
backlinks/obs.js | changed |
backlinks/obs.js | ||
---|---|---|
@@ -23,10 +23,12 @@ | ||
23 | 23 … | // an item will be removed from cache between 5 - 10 seconds after release |
24 | 24 … | // this ensures that the data is still available for a page reload |
25 | 25 … | var timer = setInterval(() => { |
26 | 26 … | oldRemove.forEach(id => { |
27 | - cache[id].destroy() | |
28 | - delete cache[id] | |
27 … | + if (cache[id]) { | |
28 … | + cache[id].destroy() | |
29 … | + delete cache[id] | |
30 … | + } | |
29 | 31 … | }) |
30 | 32 … | oldRemove.clear() |
31 | 33 … | |
32 | 34 … | // cycle |
Built with git-ssb-web