Skip to content

Commit

Permalink
Update isElectronType helper
Browse files Browse the repository at this point in the history
Fix for `undefined is not an object` in react-native
  • Loading branch information
moretti committed Feb 15, 2021
1 parent 161b62d commit 1fb7f9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/helpers/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const isIEType = () => browser.name === BROWSER_TYPES.INTERNET_EXPLORER || brows
const isMIUIType = () => browser.name === BROWSER_TYPES.MIUI;
const isElectronType = () => {
const nav = getNavigatorInstance();
const ua = nav && nav.userAgent.toLowerCase();
const ua = nav && nav.userAgent && nav.userAgent.toLowerCase();

return typeof ua === 'string' ? /electron/.test(ua) : false;
};
Expand Down

0 comments on commit 1fb7f9d

Please sign in to comment.