flutter_wechat_assets_picker icon indicating copy to clipboard operation
flutter_wechat_assets_picker copied to clipboard

Fix crash on empty paths in onAssetsChanged

Open Copilot opened this issue 3 weeks ago • 2 comments

  • [x] Analyze the bug report and understand the issue
  • [x] Locate the problematic code in asset_picker_builder_delegate.dart line 1084
  • [x] Identify the root cause: accessing .first on potentially empty paths list
  • [x] Fix the issue by adding safety check for empty paths
  • [x] Run existing tests to ensure no regression (all 13 tests passed)
  • [x] Run flutter analyze (no issues found)
  • [x] Run code review (no issues found)
  • [x] Run CodeQL security check (no issues found)
  • [x] Add changelog entry
Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] Bad state: No element</issue_title> <issue_description>Describe the bug 我们在Firebase上看到了使用了 wechat_assets_picker: 9.7.0 版本产生的一些Bug。而之前的 wechat_assets_picker: 9.0.0 并没有。

How to reproduce 暂无复现步骤

Expected behavior 期望不要发生此类异常

Screenshots (If contains)

Image

Version information

  • Device: 如图
  • OS: Android 15+
  • Package Version: v9.7.0
  • Flutter Version: 3.29.3
Image

Additional context

</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes fluttercandies/flutter_wechat_assets_picker#736

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Dec 14 '25 17:12 Copilot

@copilot write changelog

AlexV525 avatar Dec 14 '25 17:12 AlexV525

@copilot write changelog

Added changelog entry in commit abacd02.

Copilot avatar Dec 14 '25 17:12 Copilot