mirror of
https://github.com/godotengine/doc-status.git
synced 2026-02-25 10:35:55 +03:00
Add a null check when modifying the documentation link
This prevents a runtime error from appearing in the console.
This commit is contained in:
@@ -29,9 +29,15 @@
|
|||||||
|
|
||||||
document.querySelectorAll('td:last-child').forEach(td => {
|
document.querySelectorAll('td:last-child').forEach(td => {
|
||||||
const docLink = td.querySelector('a');
|
const docLink = td.querySelector('a');
|
||||||
// Only keep the last fragment and trim the file extension to make the table less wide.
|
if (docLink) {
|
||||||
const docLinkSplit = docLink.innerText.split('/');
|
// Only keep the last fragment and trim the file extension to make the table less wide.
|
||||||
docLink.innerText = docLinkSplit[docLinkSplit.length - 1].slice(0, -5);
|
const docLinkSplit = docLink.innerText.split('/');
|
||||||
|
const finalText = docLinkSplit[docLinkSplit.length - 1].slice(0, -5);
|
||||||
|
if (finalText.length >= 1) {
|
||||||
|
// Don't override the Overall link as it's short enough to be displayed in full.
|
||||||
|
docLink.innerText = finalText;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user