Skip to content

Commit 9ef1f65

Browse files
117287: Prevent /api/eperson/epersons/undefined from being fired on the create ePerson page
1 parent 638fba5 commit 9ef1f65

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
278278
* This method will initialise the page
279279
*/
280280
initialisePage() {
281-
this.subs.push(this.epersonService.findById(this.route.snapshot.params.id).subscribe((ePersonRD: RemoteData<EPerson>) => {
282-
this.epersonService.editEPerson(ePersonRD.payload);
283-
}));
281+
if (this.route.snapshot.params.id) {
282+
this.subs.push(this.epersonService.findById(this.route.snapshot.params.id).subscribe((ePersonRD: RemoteData<EPerson>) => {
283+
this.epersonService.editEPerson(ePersonRD.payload);
284+
}));
285+
}
284286
this.firstName = new DynamicInputModel({
285287
id: 'firstName',
286288
label: this.translateService.instant(`${this.messagePrefix}.firstName`),

0 commit comments

Comments
 (0)