autoconfig: get_firefox_version: add try…catch
On first run / after:
$ rm ~/.mozilla
The function fails with:
TypeError: Services.appinfo.lastAppVersion is null
Expect the failure so the script doesn't crash.
Revert "autoconfig: get_firefox_version: remove try…catch", but
with another error message.
Without this patch an error shows up when starting Firefox with the
config, until the user manually starts it again.
This reverts commit 2405aabd4c
.
This commit is contained in:
parent
b6227bde5f
commit
aaa603fae7
1 changed files with 6 additions and 1 deletions
|
@ -71,7 +71,12 @@ function log_obj(obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_firefox_version() {
|
function get_firefox_version() {
|
||||||
|
try {
|
||||||
return Services.appinfo.lastAppVersion.split(".")[0];
|
return Services.appinfo.lastAppVersion.split(".")[0];
|
||||||
|
} catch(e) {
|
||||||
|
log("Couldn't get Firefox version (expected on first start): " + e);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_firefox_version_previous() {
|
function get_firefox_version_previous() {
|
||||||
|
|
Loading…
Reference in a new issue