Merge pull request #894 from Lucas-C/bug893

Fixing "Uncaught TypeError" in shaarli.js - fix #893
This commit is contained in:
ArthurHoaro 2017-06-07 22:37:01 +02:00 committed by GitHub
commit 88535f20a9

View file

@ -418,7 +418,8 @@ window.onload = function () {
* *
* TODO: support error code in the backend for AJAX requests * TODO: support error code in the backend for AJAX requests
*/ */
var existingTags = document.querySelector('input[name="taglist"]').value.split(' '); var tagList = document.querySelector('input[name="taglist"]');
var existingTags = tagList ? tagList.value.split(' ') : [];
var awesomepletes = []; var awesomepletes = [];
// Display/Hide rename form // Display/Hide rename form
@ -515,7 +516,7 @@ window.onload = function () {
}); });
}); });
updateAwesompleteList('.rename-tag-input', document.querySelector('input[name="taglist"]').value.split(' '), awesomepletes); updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes);
}; };
/** /**