Commit 5a6ce43
fix: prevent crash when clicking null images in gallery (#110)
- Add validation in GalleryActivity.open() to check for null/invalid images before opening gallery
- Add null safety checks in GalleryAdapter to handle null image objects
- Add null checks in getCurrentImage() and menu actions to prevent NPE
- Add ProGuard rules to keep ImagesInfo classes from being obfuscated
- Show "图片不存在" toast when attempting to open gallery with invalid images
This fixes the crash that occurred only in release builds when clicking
on images in reply lists that had null or invalid image data.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2ec05e0 commit 5a6ce43
File tree
3 files changed
+56
-6
lines changed- app
- src/main/java/me/ghui/v2er/module/gallery
3 files changed
+56
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
Lines changed: 41 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
51 | 71 | | |
52 | 72 | | |
53 | 73 | | |
| |||
134 | 154 | | |
135 | 155 | | |
136 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
137 | 162 | | |
138 | 163 | | |
139 | 164 | | |
140 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
141 | 171 | | |
142 | | - | |
| 172 | + | |
143 | 173 | | |
144 | 174 | | |
145 | 175 | | |
| |||
148 | 178 | | |
149 | 179 | | |
150 | 180 | | |
151 | | - | |
| 181 | + | |
152 | 182 | | |
153 | 183 | | |
154 | 184 | | |
| |||
166 | 196 | | |
167 | 197 | | |
168 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
169 | 205 | | |
170 | 206 | | |
171 | | - | |
| 207 | + | |
172 | 208 | | |
173 | 209 | | |
174 | 210 | | |
175 | 211 | | |
176 | 212 | | |
177 | 213 | | |
178 | | - | |
| 214 | + | |
179 | 215 | | |
180 | 216 | | |
181 | | - | |
| 217 | + | |
182 | 218 | | |
183 | 219 | | |
184 | 220 | | |
| |||
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
62 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
| |||
0 commit comments