Skip to content

Commit

Permalink
fix(core/pipeline): fix Artifactory and Nexus trigger NPE
Browse files Browse the repository at this point in the history
These were throwing upon initial mount because 'error' wasn't defined.
  • Loading branch information
christopherthielen committed Oct 10, 2019
1 parent a9469e9 commit d03ce48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { ArtifactoryReaderService } from './artifactoryReader.service';
export function ArtifactoryTrigger() {
const fetchNames = useLatestPromise(() => ArtifactoryReaderService.getArtifactoryNames(), []);

const fetchError = `Error fetching artifactory names: ${fetchNames.error.data.status} ${fetchNames.error.data.error}`;
const validationMessage = fetchNames.status === 'REJECTED' ? errorMessage(fetchError) : null;
const fetchError = () =>
errorMessage(`Error fetching artifactory names: ${fetchNames.error.data.status} ${fetchNames.error.data.error}`);
const validationMessage = fetchNames.status === 'REJECTED' ? fetchError() : null;

return (
<FormikFormField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { NexusReaderService } from './nexusReader.service';
export function NexusTrigger() {
const fetchNames = useLatestPromise(() => NexusReaderService.getNexusNames(), []);

const fetchError = `Error fetching nexus names: ${fetchNames.error.data.status} ${fetchNames.error.data.error}`;
const validationMessage = fetchNames.status === 'REJECTED' ? errorMessage(fetchError) : null;
const fetchError = () =>
errorMessage(`Error fetching nexus names: ${fetchNames.error.data.status} ${fetchNames.error.data.error}`);
const validationMessage = fetchNames.status === 'REJECTED' ? fetchError() : null;

return (
<FormikFormField
Expand Down

0 comments on commit d03ce48

Please sign in to comment.