weldr: return an error if host distro wasn't found in distro registry
Prevents a nil panic, see rhbz#2035956 Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
bcf34f8c6c
commit
e668ed0ac5
1 changed files with 4 additions and 0 deletions
|
|
@ -155,6 +155,10 @@ func New(repoPaths []string, stateDir string, rpm rpmmd.RPMMD, dr *distroregistr
|
|||
archName := common.CurrentArch()
|
||||
|
||||
hostDistro := dr.GetDistro(hostDistroName)
|
||||
if hostDistro == nil {
|
||||
return nil, fmt.Errorf("host distro is not supported")
|
||||
}
|
||||
|
||||
hostArch, err := hostDistro.GetArch(archName)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Host distro does not support host architecture: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue