mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
empty source during decoding should not be fatal (#3791)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -58,7 +58,8 @@ func (s *Source) UnmarshalJSON(b []byte) error {
|
||||
func unpackSrcMetadata(s *Source, unpacker sourceUnpacker) error {
|
||||
rt := sourcemetadata.ReflectTypeFromJSONName(s.Type)
|
||||
if rt == nil {
|
||||
return fmt.Errorf("unable to find source metadata type=%q", s.Type)
|
||||
// in cases where we are converting from an SBOM without any source information, we don't want this to be fatal
|
||||
return nil
|
||||
}
|
||||
|
||||
val := reflect.New(rt).Interface()
|
||||
|
||||
Reference in New Issue
Block a user