Commit 04b0a38
authored
ROB: Resolve UnboundLocalError for xobjs in _get_image (#3684)
The xobjs variable was used outside the try-except block that defined it.
If a KeyError was caught and the id started/ended with '~' (inline images),
the code would continue but xobjs would remain undefined, causing
UnboundLocalError when trying to access non-inline images.
Initialize xobjs to None and check before using it.
---------
Co-authored-by: Yuki9814 <Yuki9814@users.noreply.github.com>
Co-authored-by: Yuki9814 <222397878+Yuki9814@users.noreply.github.com>1 parent 0e5157c commit 04b0a38
2 files changed
+36
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| 640 | + | |
640 | 641 | | |
641 | 642 | | |
642 | 643 | | |
643 | 644 | | |
644 | | - | |
| 645 | + | |
645 | 646 | | |
646 | | - | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
647 | 650 | | |
648 | 651 | | |
649 | 652 | | |
650 | 653 | | |
651 | | - | |
| 654 | + | |
652 | 655 | | |
653 | 656 | | |
654 | 657 | | |
| 658 | + | |
655 | 659 | | |
656 | 660 | | |
657 | 661 | | |
| |||
662 | 666 | | |
663 | 667 | | |
664 | 668 | | |
| 669 | + | |
665 | 670 | | |
666 | 671 | | |
667 | 672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
230 | 258 | | |
231 | 259 | | |
232 | 260 | | |
| |||
0 commit comments