Skip to content

Commit

Permalink
Merge pull request #65 from nik0kin/feature/check-for-window
Browse files Browse the repository at this point in the history
check for existence of window before using it
  • Loading branch information
dkanada authored Sep 22, 2020
2 parents 69fdf63 + 8e4b5eb commit f589209
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/apiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -3872,7 +3872,7 @@ function getRemoteImagePrefix(instance, options) {
}

function normalizeImageOptions(instance, options) {
let ratio = window.devicePixelRatio || 1;
let ratio = window && window.devicePixelRatio || 1;

if (ratio) {
if (options.minScale) {
Expand Down
2 changes: 1 addition & 1 deletion src/appStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function onCacheOpened(result) {
class AppStore {
constructor() {
try {
if (self.caches) {
if (self && self.caches) {
caches.open('embydata').then(onCacheOpened.bind(this));
}
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/connectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ export default class ConnectionManager {
resolve(servers);
};

if (window.NativeShell && typeof window.NativeShell.findServers === 'function') {
if (window && window.NativeShell && typeof window.NativeShell.findServers === 'function') {
window.NativeShell.findServers(1e3).then(onFinish, function () {
onFinish([]);
});
Expand Down

0 comments on commit f589209

Please sign in to comment.