Skip to content

Commit 9d68217

Browse files
committed
routes/index: Fix versions array bug
see #208 (comment)
1 parent 21be151 commit 9d68217

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/routes/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ export default Ember.Route.extend({
55
model() {
66
function addCrates(store, crates) {
77
for (var i = 0; i < crates.length; i++) {
8-
crates[i] = store.push(store.normalize('crate', crates[i]));
8+
const crate = crates[i];
9+
if (crate.versions == null) {
10+
// passing `null` will return an empty versions array
11+
delete crate.versions;
12+
}
13+
crates[i] = store.push(store.normalize('crate', crate));
914
}
1015
}
1116

0 commit comments

Comments
 (0)