mirror of
https://github.com/pushbits/server.git
synced 2025-05-03 12:16:20 +02:00
Return nil when application cannot retrieved
This commit is contained in:
parent
0017f9821a
commit
8966a96c39
1 changed files with 1 additions and 0 deletions
|
@ -14,6 +14,7 @@ func GetApplication(ctx *gin.Context) *model.Application {
|
||||||
app, ok := ctx.MustGet("app").(*model.Application)
|
app, ok := ctx.MustGet("app").(*model.Application)
|
||||||
if app == nil || !ok {
|
if app == nil || !ok {
|
||||||
ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occured while retrieving application from context"))
|
ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occured while retrieving application from context"))
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
Loading…
Add table
Reference in a new issue