Skip to content

Commit

Permalink
Merge pull request #1533 from GNS3/bugfix/1436
Browse files Browse the repository at this point in the history
Fix error 404 when editing a project
  • Loading branch information
grossmj authored Dec 23, 2024
2 parents 180c653 + cddce63 commit 2e581c4
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ export class ReadmeEditorComponent implements OnInit {
) {}

ngOnInit() {
this.projectService.getReadmeFile(this.controller, this.project.project_id).subscribe(file => {
if (file) this.markdown = file;
this.projectService.getReadmeFile(this.controller, this.project.project_id).subscribe({
next: (file) => {
if (file) {
this.markdown = file;
}
},
error: (err) => {
if (err.status === 404) {
// File doesn't exist yet, which is fine
this.markdown = '';
}
}
});
}
}

0 comments on commit 2e581c4

Please sign in to comment.