From 263ecd6d8bad85b3b3e2f48b81b15dbb610ebdd0 Mon Sep 17 00:00:00 2001 From: Ilja von Hoessle Date: Tue, 30 Jan 2024 12:28:01 +0100 Subject: [PATCH] fix(channel/backend.go): Implement panic if AppID typecheck fails Signed-off-by: Ilja von Hoessle --- channel/backend.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channel/backend.go b/channel/backend.go index 5ef7d73..77a800a 100644 --- a/channel/backend.go +++ b/channel/backend.go @@ -159,9 +159,10 @@ func ToEthParams(p *channel.Params) adjudicator.ChannelParams { var app common.Address if p.App != nil && !channel.IsNoApp(p.App) { appDef, ok := p.App.Def().(*AppID) - if ok { - app = ethwallet.AsEthAddr(appDef.Address) + if !ok { + panic("appDef is not of type *AppID") } + app = ethwallet.AsEthAddr(appDef.Address) } return adjudicator.ChannelParams{