diff options
author | Alan Shaw <alan@freestyle-developments.co.uk> | 2013-07-30 23:38:25 +0400 |
---|---|---|
committer | Domenic Denicola <domenic@domenicdenicola.com> | 2013-08-15 02:39:05 +0400 |
commit | b64998e73da90e34438b197aeaede58bc450d879 (patch) | |
tree | a3486eb33e1325d7b7961e5564d8be1ec32e2962 | |
parent | d85765a0f8f596d803a6bf2722e29af51a1820d1 (diff) |
Guard against falsey versions value.
-rw-r--r-- | lib/search.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/search.js b/lib/search.js index 700da2f10..fdc1c8b07 100644 --- a/lib/search.js +++ b/lib/search.js @@ -85,7 +85,7 @@ function stripData (data) { }) , url: !Object.keys(data.versions || {}).length ? data.url : null , keywords: data.keywords || [] - , version: Object.keys(data.versions)[0] || [] + , version: Object.keys(data.versions || {})[0] || [] , time: data.time && data.time.modified && (new Date(data.time.modified).toISOString() |