1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-07-15 23:54:29 +02:00

fix crash in DeleteBlock (#2040)

* fix crash in deleteblock

* fix unit test
This commit is contained in:
Doug Lauder
2022-01-05 04:02:06 -05:00
committed by GitHub
parent 6e747d5731
commit 8cf73382b4
3 changed files with 36 additions and 4 deletions

View File

@ -1594,8 +1594,8 @@ func (a *API) handleCreateSubscription(w http.ResponseWriter, r *http.Request) {
}
// check for valid block
_, err = a.app.GetBlockWithID(*container, sub.BlockID)
if err != nil {
block, err := a.app.GetBlockWithID(*container, sub.BlockID)
if err != nil || block == nil {
a.errorResponse(w, r.URL.Path, http.StatusBadRequest, "invalid blockID", err)
return
}