Fix error `No item 0 in vector of length 0`

This commit is contained in:
Daniel Compton 2018-02-14 20:50:23 +13:00
parent d89616374c
commit 3c1f48a81b
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
## Unreleased
## [0.1.21] - Unreleased
### Fixed
* Avoid throwing an error `No item 0 in vector of length 0` under certain circumstances.
## [0.1.20] - 2018-02-14

View File

@ -566,11 +566,10 @@
new-sub-state (last subscription-match-state)
timing (mapv (fn [match]
;; TODO: this isn't quite correct, shouldn't be using filtered-traces here
(let [epoch-traces (into []
(comp
(utils/id-between-xf (:id (first match)) (:id (last match))))
filtered-traces)
all-traces)
start-of-epoch (nth epoch-traces 0)
;; TODO: optimise trace searching
event-handler-trace (first (filter metam/event-handler? epoch-traces))