mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
fix: Prevent generating invalid link on empty scraper response (#5876)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user