mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Added additional check so that no errors would be thrown when no notes are present
This commit is contained in:
parent
1dbb6ca677
commit
4bc646072c
1 changed files with 2 additions and 0 deletions
|
|
@ -53,12 +53,14 @@ function editNotes(id, name) {
|
||||||
function changeName() {
|
function changeName() {
|
||||||
const id = document.getElementById("notesSelect").value;
|
const id = document.getElementById("notesSelect").value;
|
||||||
const note = notes.find(note => note.id === id);
|
const note = notes.find(note => note.id === id);
|
||||||
|
if (!note) return;
|
||||||
note.name = this.value;
|
note.name = this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeText() {
|
function changeText() {
|
||||||
const id = document.getElementById("notesSelect").value;
|
const id = document.getElementById("notesSelect").value;
|
||||||
const note = notes.find(note => note.id === id);
|
const note = notes.find(note => note.id === id);
|
||||||
|
if (!note) return;
|
||||||
note.legend = this.value;
|
note.legend = this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue