mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
cssmanager: Throw if no matching style sheet is found
This avoids a later null dereference when the stack trace isn't as useful.
This commit is contained in:
parent
5b05ee79ff
commit
742a7cd430
1 changed files with 3 additions and 1 deletions
|
@ -43,7 +43,9 @@ const makeCSSManager = (emptyStylesheetTitle, doc) => {
|
||||||
for (const s of win.document.styleSheets) {
|
for (const s of win.document.styleSheets) {
|
||||||
if (s.title === title) return s;
|
if (s.title === title) return s;
|
||||||
}
|
}
|
||||||
return null;
|
const err = new Error(`no sheet with title ${title} in doc ${doc}`)
|
||||||
|
console.error(err);
|
||||||
|
throw err;
|
||||||
};
|
};
|
||||||
|
|
||||||
const browserSheet = getSheetByTitle(emptyStylesheetTitle);
|
const browserSheet = getSheetByTitle(emptyStylesheetTitle);
|
||||||
|
|
Loading…
Reference in a new issue