Skip to content

Commit

Permalink
TypeScript 3.1 thinks document.head is nullable
Browse files Browse the repository at this point in the history
:|
  • Loading branch information
Zarel committed Oct 17, 2018
1 parent b39510a commit 77df694
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if (!Object.create) {

const PSURL = (() => {
let prefix = '';
if (document.location.protocol !== 'http:') prefix = 'https:';
if (document.location!.protocol !== 'http:') prefix = 'https:';
return prefix + '//play.pokemonshowdown.com/';
})();

Expand Down Expand Up @@ -346,7 +346,7 @@ PSBackground.subscribe(bgUrl => {
buttonStyleElem = new HTMLStyleElement();
buttonStyleElem.id = 'mainmenubuttoncolors';
buttonStyleElem.textContent = cssBuf;
document.head.appendChild(buttonStyleElem);
document.head!.appendChild(buttonStyleElem);
}
} else {
buttonStyleElem.textContent = cssBuf;
Expand Down

0 comments on commit 77df694

Please sign in to comment.