fix nil panic on null entry

This commit is contained in:
yusing 2025-01-06 04:58:11 +08:00
parent bc2335a54e
commit 0850562bf9

View file

@ -87,6 +87,9 @@ func FromEntries(entries RawEntries) (Routes, E.Error) {
routes := NewRoutes() routes := NewRoutes()
entries.RangeAllParallel(func(alias string, en *RawEntry) { entries.RangeAllParallel(func(alias string, en *RawEntry) {
if en == nil {
en = new(RawEntry)
}
en.Alias = alias en.Alias = alias
if strings.HasPrefix(alias, "x-") { // x properties if strings.HasPrefix(alias, "x-") { // x properties
return return