Open
Bug 305688
Opened 20 years ago
Updated 17 years ago
please look before leaping for filepicker directory
Categories
(SeaMonkey :: UI Design, defect)
Tracking
(Not tracked)
NEW
People
(Reporter: timeless, Assigned: timeless)
References
()
Details
Attachments
(1 file)
|
1.00 KB,
patch
|
darin.moz
:
review-
neil
:
superreview+
|
Details | Diff | Splinter Review |
Exception ``[Exception... "Component returned failure code: 0x8000ffff
(NS_ERROR_UNEXPECTED) [nsIPrefBranch.getComplexValue]" nsresult: "0x8000ffff
(NS_ERROR_UNEXPECTED)" location: "JS frame ::
chrome://communicator/content/contentAreaUtils.js :: poseFilePicker :: line 504"
data: no]'' thrown from function poseFilePicker(aFpP=Object:{8}) in
<chrome://communicator/content/contentAreaUtils.js> line 504.
Stopped for thrown exception.
#0: function poseFilePicker(aFpP=Object:{8}) in
<chrome://communicator/content/contentAreaUtils.js> line 504
502: // Try and pull in download directory pref
503: try {
504: dir = branch.getComplexValue(kDownloadDirPref, nsILocalFile);
505: } catch (e) { }
506:
Continuing from thrown exception.
Error ``dir has no properties'' [xs] in file
``chrome://communicator/content/contentAreaUtils.js'', line 522, character 0.
Stopped for error handler.
#0: function poseFilePicker(aFpP=Object:{8}) in
<chrome://communicator/content/contentAreaUtils.js> line 522
520:
521: try {
522: if (dir.exists())
523: fp.displayDirectory = dir;
524: } catch (e) { }
Attachment #193623 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #193623 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 2•20 years ago
|
||
Comment on attachment 193623 [details] [diff] [review]
look before leaping
> try {
>- dir = branch.getComplexValue(kDownloadDirPref, nsILocalFile);
>+ if (branch.getPrefType(kDownloadDirPref) == branch.PREF_STRING))
>+ dir = branch.getComplexValue(kDownloadDirPref, nsILocalFile);
> } catch (e) { }
I'm not convinced that this is a suitable use of the API e.g. if the pref used
to be set but was since reset either via about:config or by switching profile,
so I'm requesting a second opinion.
> try {
>- if (dir.exists())
>+ if (dir && dir.exists())
> fp.displayDirectory = dir;
> } catch (e) { }
I'd almost remove the try/catch at this point as the only thing that can stop
is now is OOM which I don't see the point of masking.
Attachment #193623 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #193623 -
Flags: superreview+
Attachment #193623 -
Flags: review?(neil.parkwaycc.co.uk)
Attachment #193623 -
Flags: review?(darin)
Comment 3•20 years ago
|
||
Comment on attachment 193623 [details] [diff] [review]
look before leaping
> try {
>- dir = branch.getComplexValue(kDownloadDirPref, nsILocalFile);
>+ if (branch.getPrefType(kDownloadDirPref) == branch.PREF_STRING))
>+ dir = branch.getComplexValue(kDownloadDirPref, nsILocalFile);
> } catch (e) { }
Can you please explain why this part of the patch is needed? It
seems like over-engineering to me since the call to getComplexValue
is in a try-catch block, but I'm probably missing something.
Comment 4•20 years ago
|
||
Comment on attachment 193623 [details] [diff] [review]
look before leaping
Marking r- to get attention. Please see my previous comment.
Attachment #193623 -
Flags: review?(darin) → review-
You need to log in
before you can comment on or make changes to this bug.
Description
•