Skip to content

Commit c11de23

Browse files
committed
mirage/crates: Fix error handling for GET /api/v1/crates/:id/owner_user request handler
1 parent f466b43 commit c11de23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mirage/route-handlers/crates.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export function register(server) {
103103
server.get('/api/v1/crates/:crate_id/owner_user', function(schema, request) {
104104
let crateId = request.params.crate_id;
105105
let crate = schema.crates.find(crateId);
106+
if (!crate) return notFound();
107+
106108
let users = schema.users.find(crate._owner_users);
107109

108110
let response = this.serialize(users);

0 commit comments

Comments
 (0)