The default bug view has changed. See this FAQ.

Error: id is null Source file: chrome://.../addressingWidgetOverlay.js Line: 1038

RESOLVED FIXED in seamonkey2.1b2

Status

SeaMonkey
MailNews: Composition
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Philip Chee, Assigned: Philip Chee)

Tracking

Trunk
seamonkey2.1b2

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

7 years ago
From Thunderbird Bug #256049:

> timeless      2004-08-18 13:17:20 PDT
> 
> Error ``id has no properties'' [xs] in file
> ``chrome://messenger/content/messengercompose/addressingWidgetOverlay.js'', line
> 1057, character 0.
> Stopped for error handler.
> #0: function awDocumentKeyPress(event=Event:{0}) in
> <chrome://messenger/content/messengercompose/addressingWidgetOverlay.js> line 1057
> 1055: try {
> 1056: var id = event.target.getAttribute('id');
> 1057: if (id.substr(0, 11) == 'addressCol1')
> 1058: awMenulistKeyPress(event, event.target);
> 1059: } catch (e) { }

On SeaMonkey trunk I get this:

Error: id is null
Source file: chrome://messenger/content/messengercompose/addressingWidgetOverlay.js
Line: 1038
(Assignee)

Comment 1

7 years ago
Created attachment 482058 [details] [diff] [review]
Proposed fix v1.0

> -    if (id.substr(0, 11) == 'addressCol1')
> +    if (id && id.substr(0, 11) == 'addressCol1')

If we are in the content area we don't have any .id properties natch.

> -  } catch (e) { }
> +  }
> +  catch (e)

Do we still need a try catch block here?

Also we should consider moving the eventListener from the document to nearer the menulist as suggested by Neil (in Bug 124304 Comment 24). Now that the popup handling code has been rewritten by the other Neil the original problems probably don't exist any more.
Attachment #482058 - Flags: review?(mnyromyr)
Attachment #482058 - Flags: feedback?(neil)
(Assignee)

Comment 2

7 years ago
Comment on attachment 482058 [details] [diff] [review]
Proposed fix v1.0

># HG changeset patch
># User Philip Chee <philip.chee@gmail.com>
># Date 1286645486 -28800
># Node ID edc064f9beb1ae8ae103747b5952aae1329a9e3e
># Parent  7661b2db37db5c2b06608be788243ff805c6412c
>Bug 603101 Error: id is null Source file: chrome://.../addressingWidgetOverlay.js Line: 1038
>
>diff --git a/suite/mailnews/compose/addressingWidgetOverlay.js b/suite/mailnews/compose/addressingWidgetOverlay.js
>--- a/suite/mailnews/compose/addressingWidgetOverlay.js
>+++ b/suite/mailnews/compose/addressingWidgetOverlay.js
>@@ -1028,21 +1028,26 @@ function awSizerResized(aSplitter)
>   listbox.height = listbox.boxObject.height;
>   // remove all the heights set on the splitter's previous siblings
>   for (let sib = aSplitter.previousSibling; sib; sib = sib.previousSibling)
>     sib.removeAttribute("height");
> }
> 
> function awDocumentKeyPress(event)
> {
>-  try {
>+  try
>+  {
>     var id = event.target.getAttribute('id');
>-    if (id.substr(0, 11) == 'addressCol1')
>+    if (id && id.substr(0, 11) == 'addressCol1')
>       awMenulistKeyPress(event, event.target);
>-  } catch (e) { }
>+  }
>+  catch (e)
>+  {
>+    Components.utils.reportError(e);
>+  }
> }
> 
> function awRecipientInputCommand(event, inputElement)
> {
>   gContentChanged=true; 
>   setupAutocomplete(); 
> }
>
Attachment #482058 - Flags: feedback?(neil) → review?(neil)
(Assignee)

Comment 3

7 years ago
Created attachment 482142 [details] [diff] [review]
Patch v1.1 use the .id like Thunderbird

Alternative patch.
Attachment #482142 - Flags: review?(neil)
(Assignee)

Comment 4

7 years ago
Comment on attachment 482142 [details] [diff] [review]
Patch v1.1 use the .id like Thunderbird

># HG changeset patch
># User Philip Chee <philip.chee@gmail.com>
># Date 1286725449 -28800
># Node ID 2836f5570039bdad359da435cc83f1e7770320aa
># Parent  bfd1320b39acbd8c1aaab876abbd13196f2dfda3
>Bug 603101 Error: id is null Source file: chrome://.../addressingWidgetOverlay.js Line: 1038
>
>diff --git a/suite/mailnews/compose/addressingWidgetOverlay.js b/suite/mailnews/compose/addressingWidgetOverlay.js
>--- a/suite/mailnews/compose/addressingWidgetOverlay.js
>+++ b/suite/mailnews/compose/addressingWidgetOverlay.js
>@@ -1029,20 +1029,23 @@ function awSizerResized(aSplitter)
>   // remove all the heights set on the splitter's previous siblings
>   for (let sib = aSplitter.previousSibling; sib; sib = sib.previousSibling)
>     sib.removeAttribute("height");
> }
> 
> function awDocumentKeyPress(event)
> {
>   try {
>-    var id = event.target.getAttribute('id');
>-    if (id.substr(0, 11) == 'addressCol1')
>+    var id = event.target.id;
>+    if (id && id.substr(0, 11) == 'addressCol1')
>       awMenulistKeyPress(event, event.target);
>-  } catch (e) { }
>+  }
>+  catch (e) {
>+    Components.utils.reportError(e);
>+  }
> }
> 
> function awRecipientInputCommand(event, inputElement)
> {
>   gContentChanged=true; 
>   setupAutocomplete(); 
> }
>
Attachment #482142 - Flags: review?(mnyromyr)

Comment 5

7 years ago
Ideally we would ditch awDocumentKeyPress and call awMenulistKeyPress directly from the menulist like we do with awRecipientKeyPress from the textbox.
(Assignee)

Comment 6

7 years ago
> Ideally we would ditch awDocumentKeyPress and call awMenulistKeyPress directly
> from the menulist like we do with awRecipientKeyPress from the textbox.
So if I use onkeypress on the menulist I don't have to use a capturing eventlistener as stated in Bug 124304 Comment 24?
(Assignee)

Comment 7

7 years ago
STR: start in the address widget. Tab into the content area type a bit tab a bit. Look at the error console.
(Assignee)

Comment 8

7 years ago
Created attachment 483482 [details] [diff] [review]
Patch v1.2 use awMenulistKeyPress directly

> neil@parkwaycc.co.uk      2010-10-10 11:41:41 PDT
> 
> Ideally we would ditch awDocumentKeyPress and call awMenulistKeyPress directly
> from the menulist like we do with awRecipientKeyPress from the textbox.
This works 100%.
New patch using this approach.
Attachment #482058 - Attachment is obsolete: true
Attachment #482142 - Attachment is obsolete: true
Attachment #483482 - Flags: superreview?(neil)
Attachment #483482 - Flags: review?(mnyromyr)
Attachment #482058 - Flags: review?(neil)
Attachment #482058 - Flags: review?(mnyromyr)
Attachment #482142 - Flags: review?(neil)
Attachment #482142 - Flags: review?(mnyromyr)

Updated

7 years ago
Attachment #483482 - Flags: superreview?(neil) → superreview+

Updated

7 years ago
Attachment #483482 - Flags: review?(mnyromyr) → review+
(Assignee)

Comment 9

7 years ago
Pushed to comm-central
http://hg.mozilla.org/comm-central/rev/db0b3e35e5b3
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.