Fix #4191: add defaults to avoid throwing (#4195)

This commit is contained in:
Kegsay 2017-06-06 12:38:06 +01:00 committed by GitHub
parent ce01bcac2d
commit 4cec4f066d

View File

@ -160,8 +160,8 @@ export default class WebPlatform extends VectorBasePlatform {
const appName = u.format(); const appName = u.format();
const ua = new UAParser(); const ua = new UAParser();
const browserName = ua.getBrowser().name; const browserName = ua.getBrowser().name || "unknown browser";
const osName = ua.getOS().name; const osName = ua.getOS().name || "unknown os";
return _t('%(appName)s via %(browserName)s on %(osName)s', {appName: appName, browserName: browserName, osName: osName}); return _t('%(appName)s via %(browserName)s on %(osName)s', {appName: appName, browserName: browserName, osName: osName});
} }