Skip to content

Commit d2ee49d

Browse files
committedJun 2, 2024
empty attribute
1 parent 600ccfd commit d2ee49d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎internal/content/extended.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ package content
33
import (
44
"encoding/xml"
55
"fmt"
6-
"github.com/valyala/bytebufferpool"
7-
86
"github.com/Equationzhao/g/internal/global"
97
"github.com/Equationzhao/g/internal/item"
108
"github.com/Equationzhao/g/internal/render"
119
"github.com/pkg/xattr"
10+
"github.com/valyala/bytebufferpool"
1211
"howett.net/plist"
1312
)
1413

@@ -32,6 +31,10 @@ func formatBytes(bytes []byte) string {
3231

3332
// formatXattrValue attempts to parse the xattr value and returns a human-readable string.
3433
func formatXattrValue(value []byte) string {
34+
if len(value) == 0 {
35+
return "<empty>"
36+
}
37+
3538
// Check if the value is a binary plist
3639
var plistData any
3740
if _, err := plist.Unmarshal(value, &plistData); err == nil {

0 commit comments

Comments
 (0)