Commit 4acbcea
committed
Return a 404 if a Scratch project doesn't exist
Fixes RaspberryPiFoundation/digital-editor-issues#1269
Previously a 500 was raised because we would try to access the scratch component of an `nil` object.
I've also added another case for if the project exists but isn't a scratch project as I expect that would error too.1 parent 38be3fb commit 4acbcea
2 files changed
Lines changed: 17 additions & 0 deletions
File tree
- app/controllers/api/scratch
- spec/features/scratch
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
21 | 35 | | |
0 commit comments