Closed
Bug 240821
Opened 20 years ago
Closed 20 years ago
Remove unneeded try+catch associated to |smtpService|
Categories
(SeaMonkey :: MailNews: Account Configuration, defect)
SeaMonkey
MailNews: Account Configuration
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8alpha1
People
(Reporter: sgautherie, Assigned: sgautherie)
References
()
Details
Attachments
(4 obsolete files)
While working on bug 237448, I noticed that |smtpService.*| is used both within or without try+catch, which seems inconsistent. Since there is no complain on the 'without' cases, I assume that the 'within' cases are "over-protected".
Assignee | ||
Comment 1•20 years ago
|
||
Assignee: sspitzer → gautheri
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•20 years ago
|
||
Comment on attachment 146377 [details] [diff] [review] (Av1) <am-smtp.js> [Checked in: Comment 4] I propose this patch as a first case; if you r+ it, I'll post other patch(es) for the few other files; if you r- it, tell me if more try+catch are needed, (or what).
Attachment #146377 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 3•20 years ago
|
||
Comment on attachment 146377 [details] [diff] [review] (Av1) <am-smtp.js> [Checked in: Comment 4] Yes, it looks like defaultServer always succeeds (well an extreme memory corruption could cause it to fail...)
Attachment #146377 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Assignee | ||
Updated•20 years ago
|
Attachment #146377 -
Flags: superreview?(mscott)
Updated•20 years ago
|
Attachment #146377 -
Flags: superreview?(mscott) → superreview+
Assignee | ||
Comment 4•20 years ago
|
||
Comment on attachment 146377 [details] [diff] [review] (Av1) <am-smtp.js> [Checked in: Comment 4] Check in: { 2004-04-29 03:17 neil%parkwaycc.co.uk mozilla/ mailnews/ base/ prefs/ resources/ content/ am-smtp.js 1.13 }
Attachment #146377 -
Attachment description: (Av1) <am-smtp.js> → (Av1) <am-smtp.js>
[Checked in: Comment 4]
Attachment #146377 -
Attachment is obsolete: true
Assignee | ||
Comment 5•20 years ago
|
||
Assignee | ||
Comment 6•20 years ago
|
||
Comment on attachment 147357 [details] [diff] [review] (Bv1-r) <*.js> (for review only) Could you test/review this patch ? Thanks.
Attachment #147357 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 7•20 years ago
|
||
Comment on attachment 147357 [details] [diff] [review] (Bv1-r) <*.js> (for review only) >- try {element["serverkey"] = smtpService.defaultServer.key;} >- catch(ex){} >+ element["serverkey"] = smtpService.defaultServer.key; It's just possible that smtpService.defaultServer might be null here, so you can't be sure that there is a default key. >- try { > if (!smtpServer) { > smtpServer = smtpService.createSmtpServer(); > window.arguments[0].addSmtpServer = smtpServer.key; > } > >+ try { It's not worth moving this. In fact createSmtpServer might just fail. > // can't delete default server > var server = getSelectedServer(); >- try{ > if (smtpService.defaultServer == server) { > dump("Selected default server!\n"); > setDefaultButton.setAttribute("disabled", "true"); >@@ -146,7 +146,6 @@ function updateButtons() > setDefaultButton.removeAttribute("disabled"); > deleteButton.removeAttribute("disabled"); > } >- } catch(ex){} It would have been nice to see all the context here (try -u4 or -u5) just to check that the missing lines are what I'm guessing they are. >- try{ > var smtpServer = parent.smtpService.defaultServer; > smtpServerName = pageData.server.smtphostname.value; > if (!smtpServerName && smtpServer.hostname) > smtpServerName = smtpServer.hostname; >- } catch(ex){} Again, the defaultServer might possibly be null. >- try { > // don't use the default smtp server if it has a redirector type > if (!parent.smtpService.defaultServer.redirectorType) { > smtpServer = parent.smtpService.defaultServer; > setPageData(pageData, "identity", "smtpServerKey", smtpServer.key); > } >- } >- catch(ex){} I think defaultServer could be null here to.
Attachment #147357 -
Flags: review?(neil.parkwaycc.co.uk) → review-
Assignee | ||
Comment 8•20 years ago
|
||
Bv1-r, with comment 7 suggestion(s).
Attachment #147357 -
Attachment is obsolete: true
Assignee | ||
Comment 9•20 years ago
|
||
Comment on attachment 147489 [details] [diff] [review] (Bv2-r) <*.js> (for review only) [Check in: See Bv2-ci] Could you test/review this patch ? Thanks.
Attachment #147489 -
Flags: review?
Assignee | ||
Comment 10•20 years ago
|
||
Comment on attachment 147489 [details] [diff] [review] (Bv2-r) <*.js> (for review only) [Check in: See Bv2-ci] Could you test/review this patch ? Thanks.
Attachment #147489 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Updated•20 years ago
|
Attachment #147489 -
Flags: review?
Comment 11•20 years ago
|
||
Comment on attachment 147489 [details] [diff] [review] (Bv2-r) <*.js> (for review only) [Check in: See Bv2-ci] This looks ok as far as I can tell for a -w diff although some of your reindentations look suspicious.
Attachment #147489 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Assignee | ||
Updated•20 years ago
|
Attachment #147489 -
Flags: superreview?(Henry.Jia)
Assignee | ||
Comment 12•20 years ago
|
||
Comment on attachment 147489 [details] [diff] [review] (Bv2-r) <*.js> (for review only) [Check in: See Bv2-ci] No super-review from <Henry.Jia@sun.com> since "2004-05-09" :-(
Attachment #147489 -
Flags: superreview?(Henry.Jia) → superreview?(mscott)
Updated•20 years ago
|
Attachment #147489 -
Flags: superreview?(mscott) → superreview+
Assignee | ||
Comment 13•20 years ago
|
||
Bv2-r, with white space differences.
Comment 14•20 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•20 years ago
|
Attachment #149224 -
Attachment description: (Bv2-ci) <*.js> (for check in) → (Bv2-ci) <*.js> (for check in)
[Checked in: Comment 14]
Attachment #149224 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #147489 -
Attachment description: (Bv2-r) <*.js> (for review only) → (Bv2-r) <*.js> (for review only)
[Check in: See Bv2-ci]
Attachment #147489 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Target Milestone: --- → mozilla1.8alpha
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•