Closed Bug 48356 Opened 24 years ago Closed 24 years ago

"Application error" window appears when CurrentPage.findInPage(...) is invoked without URL

Categories

(Core Graveyard :: Java APIs to WebShell, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ovk, Assigned: ashuk)

Details

Attachments

(8 files)

If no URL is loaded and CurrentPage.findInPage(...) is invoked, then 
"Application error" window appears:

   The exception Breakpoint.
   A breakpoint has been reached.
   (0x80000003) occurred in the aplication at location 0x77f76274.

How to reproduce:
1. Start webclient without any URL.
2. Choose the menu item "Search->Find".
3. In the find dialog window type something in "Find" field.
4. Press the "Find" button.


Mozilla M16, Webclient source from Aug 07, 2000. WinNT 4.0 SP4. JDK 1.3.0R.
Summary: "Application error" window appears when CurrentPage.findInPage(...) is invoked without URL → "Application error" window appears when CurrentPage.findInPage(...) is invoked without URL
Confirming again. ovk@sparc.spb.su - I've fixed your Bugzilla permissions so you 
submit NEW bugs by default.

Gerv
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: edburns → ashuk
Reassign to Ashu.
Status: NEW → ASSIGNED
Added patch to fix bug. Checked in fix.
Oleg, pls get this fix and run the new code thro your QA tests. thanks.

_Ashu
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
"Application error" window still appears:

It appears when interfaceRequestor->GetInterface(NS_GET_IID(nsIDOMWindow), 
getter_AddRefs(domWindow)) is called.

May be we need some check before interfaceRequestor->GetInterface(...) is 
called. Something like that:

nsIURI* url;
rv=initContext->docShell->GetCurrentURI(&url);
 if (NS_FAILED(rv) || nsnull == url)  {
      ::util_ThrowExceptionToJava(env, "Exception: NULL URL passed to Find 
call");
      return;
 } 

I tested findInPage(..) method with this code and it works. But, may be, there 
are other ways exist.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The patch suggested by Oleg looks good. I'll check it in and confirm that it
works fine before closing this bug.

thanks
_Ashu
Status: REOPENED → ASSIGNED
tar.gz attached multiple times by mistake due to slow responding bugzilla
server.

_Ashu
Comments on http://bugzilla.mozilla.org/showattachment.cgi?attach_id=14422 : 

Use nsCOMPtr<nsIURI> and getter_AddRefs().  If you do that, then I give you 
r=,a= edburns.
Patch checked into cvs. Pls see 09/12/00 09:32 for diff -u of proposed patch and 
09/12/00 09:31 for modified CurrentPageImpl.cpp file

_Ashu
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Works for Me
Platform: PC
OS: Windows 98
Mozilla Version: 2000100508

Marking as Verified
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: