Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复错误 #123

Merged
merged 3 commits into from
Nov 14, 2024
Merged

fix: 修复错误 #123

merged 3 commits into from
Nov 14, 2024

Conversation

icarus-ai
Copy link
Contributor

No description provided.

Md5: md5,
Sha1: sha1,
Size: uint32(length),
Summary: utils.Ternary(len(summary) == 0, "", summary[0]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

显然这是不对的,如果没有传summary,这就是一个数组越界访问

return uint32(info.Time)
}
return uint32(length)
return utils.Ternary(err == nil, uint32(info.Time), uint32(length))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果err不是nil,info.Time就是空指针引用

Md5: md5,
Sha1: sha1,
Size: uint32(length),
Summary: utils.Ternary(len(summary) == 0, "", summary[0]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Compat: &message.VideoFile{},
Size: uint32(length),
Thumb: NewVideoThumb(thumb),
Summary: utils.Ternary(len(summary) == 0, "", summary[0]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

写宏写混了,意识没切过来😓😓😓😓😓

message/elements.go Outdated Show resolved Hide resolved
@icarus-ai icarus-ai changed the title 简化代码 & 修复错误 fix: 修复错误 Nov 14, 2024
@Redmomn Redmomn merged commit 1e27903 into LagrangeDev:master Nov 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants