diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go
index <HASH>..<HASH> 100644
--- a/core/corehttp/gateway_handler.go
+++ b/core/corehttp/gateway_handler.go
@@ -662,6 +662,7 @@ func (i *gatewayHandler) deleteHandler(w http.ResponseWriter, r *http.Request) {
 	nnode, err := root.GetDirectory().GetNode()
 	if err != nil {
 		webError(w, "WritableGateway: failed to finalize", err, http.StatusInternalServerError)
+		return
 	}
 	ncid := nnode.Cid()
fix(gw): missing return if dir fails to finalize (#<I>)