mirror of
https://github.com/stashapp/stash.git
synced 2026-01-05 15:13:17 +01:00
fix: Prevent generating invalid link on empty scraper response (#5876)
This commit is contained in:
parent
60f1ee2360
commit
155dbc370b
2 changed files with 14 additions and 2 deletions
|
|
@ -165,6 +165,12 @@ const PerformerResult: React.FC<IPerformerResultProps> = ({
|
|||
|
||||
const selectedSource = !selectedID ? "skip" : "existing";
|
||||
|
||||
const safeBuildPerformerScraperLink = (id: string | null | undefined) => {
|
||||
return stashboxPerformerPrefix && id
|
||||
? `${stashboxPerformerPrefix}${id}`
|
||||
: undefined;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="row no-gutters align-items-center mt-2">
|
||||
<div className="entity-name">
|
||||
|
|
@ -172,7 +178,7 @@ const PerformerResult: React.FC<IPerformerResultProps> = ({
|
|||
<b className="ml-2">
|
||||
<PerformerLink
|
||||
performer={performer}
|
||||
url={`${stashboxPerformerPrefix}${performer.remote_site_id}`}
|
||||
url={safeBuildPerformerScraperLink(performer.remote_site_id)}
|
||||
/>
|
||||
</b>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -134,6 +134,12 @@ const StudioResult: React.FC<IStudioResultProps> = ({
|
|||
|
||||
const selectedSource = !selectedID ? "skip" : "existing";
|
||||
|
||||
const safeBuildStudioScraperLink = (id: string | null | undefined) => {
|
||||
return stashboxStudioPrefix && id
|
||||
? `${stashboxStudioPrefix}${id}`
|
||||
: undefined;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="row no-gutters align-items-center mt-2">
|
||||
<div className="entity-name">
|
||||
|
|
@ -141,7 +147,7 @@ const StudioResult: React.FC<IStudioResultProps> = ({
|
|||
<b className="ml-2">
|
||||
<StudioLink
|
||||
studio={studio}
|
||||
url={`${stashboxStudioPrefix}${studio.remote_site_id}`}
|
||||
url={safeBuildStudioScraperLink(studio.remote_site_id)}
|
||||
/>
|
||||
</b>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue