Repository navigation
Commit b9cd330
committed
fix(antdx): FileCard / FileCard.List.Item crash when
Both constructors handle a `src` dict that has a `path` but no `url` by
serving the local file, but the branch referenced `self.item`, an attribute
that does not exist on either class, so the constructor raised
AttributeError instead. The next line then unconditionally overwrote
`self.src` with the raw dict, so the branch could never take effect even if
the lookup had worked.
Read the path from `src` itself and merge the served file info back into
`src` before the assignment, which is what the code was written to do.
Behaviour for string, url-bearing dict and empty `src` values is unchanged.src is a file dict without url
1 parent 2ff63d5 commit b9cd330
3 files changed
Lines changed: 7 additions & 2 deletions
File tree
- .changeset
- backend/modelscope_studio/components/antdx/file_card
- list/item
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
0 commit comments