Commit 5f26760d authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Matija Obreza
Browse files

Small null pointer fix

parent ccfb430b
......@@ -46,7 +46,7 @@ class CreatorsStep extends StepperTemplate<ICreatorsStepProps> {
)
private updateIfNeed = () => {
const { item, formValues: { creators }, updateCreatorRequest } = this.props;
if (item) {
if (item && item.creators) {
item.creators.map((oldCreator) => {
const creator = creators.find((c) => c.uuid === oldCreator.uuid);
if (!_.isEqual({ ...creator }, { ...oldCreator })) {
......
......@@ -62,7 +62,7 @@ class LocationStep extends StepperTemplate<ILocationStepProps> {
private updateIfNeed = () => {
const { item, formValues: { locations }, updateLocationRequest } = this.props;
if (item) {
if (item && item.locations) {
item.locations.map((oldLocation) => {
const updatedLocation = locations.find((l) => l.uuid === oldLocation.uuid);
if (!_.isEqual({ ...updatedLocation }, { ...oldLocation })) {
......
......@@ -58,7 +58,7 @@ class CreatorsStep extends StepperTemplate<ICreatorsStepProps> {
private updateIfNeed = () => {
const { item: subset, formValues : { creators }, updateSubsetCreatorRequest } = this.props;
if (subset) {
if (subset && subset.creators) {
subset.creators.map((oldCreator) => {
const creator = creators.find((c) => c.uuid === oldCreator.uuid);
if (!_.isEqual({...creator}, {...oldCreator}) && creator.fullName) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment