Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Find next" bug when no searches have been performed #182

Open
GoogleCodeExporter opened this issue Sep 22, 2015 · 0 comments
Open

"Find next" bug when no searches have been performed #182

GoogleCodeExporter opened this issue Sep 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Open an editor
2. Invoke find-next action
3. Dialog pops up saying "null" can't be found

What is the expected output? What do you see instead?

No searches have yet been performed, so nothing should happen (or *perhaps* a 
dialog saying "nothing to search for")

What version of the product are you using? On what operating system?

This applies to jsyntaxpane-0.9.5

Please provide any additional information below.

Here is a patch that simply ignores the action if no search has yet been 
performed:


--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -17,7 +17,8 @@
     public void actionPerformed(JTextComponent target, SyntaxDocument sdoc,
             int dot, ActionEvent e) {
         DocumentSearchData dsd = DocumentSearchData.getFromEditor(target);
-        if (dsd != null) {
+
+        if (dsd != null && dsd.getPattern() != null) {
             if(!dsd.doFindNext(target)) {
                dsd.msgNotFound(target);
            }

Original issue reported on code.google.com by [email protected] on 6 Mar 2012 at 3:19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant