outposts/proxy: fix error checking for type assertion

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-26 14:56:34 +01:00
parent 4a56b5e827
commit f246da6b73
2 changed files with 8 additions and 2 deletions

View File

@ -15,7 +15,11 @@ func (a *Application) handleRedirect(rw http.ResponseWriter, r *http.Request) {
if err != nil { if err != nil {
s.Values[constants.SessionOAuthState] = []string{} s.Values[constants.SessionOAuthState] = []string{}
} }
state := s.Values[constants.SessionOAuthState].([]string) state, ok := s.Values[constants.SessionOAuthState].([]string)
if !ok {
s.Values[constants.SessionOAuthState] = []string{}
state = []string{}
}
s.Values[constants.SessionOAuthState] = append(state, newState) s.Values[constants.SessionOAuthState] = append(state, newState)
err = s.Save(r, rw) err = s.Save(r, rw)
if err != nil { if err != nil {

View File

@ -88,7 +88,9 @@ export class DeleteForm extends ModalButton {
return html``; return html``;
} }
return html` return html`
<section class="pf-c-modal-box__body pf-c-page__main-section pf-m-light"> <section
class="pf-c-modal-box__body pf-c-page__main-section pf-m-light"
>
<form class="pf-c-form pf-m-horizontal"> <form class="pf-c-form pf-m-horizontal">
<p>${t`The following objects use ${objName} `}</p> <p>${t`The following objects use ${objName} `}</p>
<ul class="pf-c-list"> <ul class="pf-c-list">