Skip to content

Commit 83c8c64

Browse files
committed
Fix crash when no id specified
1 parent b68ec23 commit 83c8c64

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class App extends React.Component<any, State> {
5050
onFileSelected(fileContent) {
5151
sessionStorage.setItem("familyData", fileContent);
5252
loadData(JSON.parse(fileContent));
53-
window.location.href +="view";
53+
if (window.location.href.endsWith("/")) {
54+
window.location.href += "view";
55+
} else {
56+
window.location.href += "/view";
57+
}
5458
}
5559

5660
componentDidMount() {

src/backend/ModelGraph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ModelGraph extends GedcomX.Root {
5858
}
5959

6060
let startPerson: GedcomX.Person;
61-
if (startId !== null) {
61+
if (startId !== null && startId.length > 0) {
6262
startPerson = this.getPersonById(startId);
6363
} else {
6464
startPerson = this.persons[0];

0 commit comments

Comments
 (0)