Bug 508216: Error : 'val is null' the first time the preferences panel is showed [r=mark.finkle]

This commit is contained in:
Vivien Nicolas 2009-08-04 09:26:58 -04:00
Родитель 59da8d79ba
Коммит dcac979084
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -45,8 +45,11 @@
<binding id="richpref-base">
<implementation>
<constructor>
this.pref._setValue(this.pref.valueFromPreferences, false);
this.prefChanged();
let prefValue = this.pref.valueFromPreferences;
if (prefValue != null) {
this.pref._setValue(prefValue, false);
this.prefChanged();
}
</constructor>
<method name="fireEvent">
@ -54,15 +57,15 @@
<parameter name="funcStr"/>
<body>
<![CDATA[
var body = funcStr || this.getAttribute(eventName);
let body = funcStr || this.getAttribute(eventName);
if (!body)
return;
try
{
var event = document.createEvent("Events");
let event = document.createEvent("Events");
event.initEvent(eventName, true, true);
var f = new Function("event", body);
let f = new Function("event", body);
f.call(this, event);
}
catch (e)