fix(datetime): guard against empty date format string - #519
Conversation
There was a problem hiding this comment.
Sorry @MyLeeJiEun, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 4 hours and 13 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds an early exit for short-date formats that become empty after year removal, preventing the subsequent format.at(0) access from causing a dock crash. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
1. Add early return when the format string is empty after stripping the year token 2. Prevent out-of-bounds access on format.at(0) with an empty format Log: Avoid potential crash when a short date format becomes empty after year removal Influence: Prevents dock crash on empty short date format fix(datetime): 防止短日期格式字符串为空 1. 在移除年份标记后格式字符串为空时提前返回 2. 避免空格式串上 format.at(0) 的越界访问 Log: 避免短日期格式移除年份后为空导致的潜在崩溃 PMS: TASK-395933 Influence: 修复空短日期格式可能导致的崩溃
e388320 to
f2d3763
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, MyLeeJiEun The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Log: Avoid potential crash when a short date format becomes empty after year removal
Influence: Prevents dock crash on empty short date format
fix(datetime): 防止短日期格式字符串为空
Log: 避免短日期格式移除年份后为空导致的潜在崩溃
PMS: TASK-395933
Influence: 修复空短日期格式可能导致的崩溃
Summary by Sourcery
Bug Fixes: