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

Crash sometimes when resume back to area #1070

Closed
jzlhll opened this issue Jan 14, 2022 · 1 comment · Fixed by #1075
Closed

Crash sometimes when resume back to area #1070

jzlhll opened this issue Jan 14, 2022 · 1 comment · Fixed by #1075

Comments

@jzlhll
Copy link

jzlhll commented Jan 14, 2022

0.10.7 richtextfx, mac os.

20220114171356

This crash photo from my user.

Code is below in GenericStyledArea.java

       setInputMethodRequests( new InputMethodRequests()
        {
            @Override public Point2D getTextLocation(int offset ) {
                Bounds charBounds = getCaretBounds().get(); //here it the crash point
                return new Point2D( charBounds.getMaxX() - 5, charBounds.getMaxY() );
            }

            @Override public int getLocationOffset( int x, int y ) {
                return 0;
            }

            @Override public void cancelLatestCommittedText() {}

            @Override public String getSelectedText() {
                return getSelectedText();
            }
        });

Copy this code , IDEA will auto warn that "getCaretBounds().get();" does not check ifPresent

Please check it.

@Jugen
Copy link
Collaborator

Jugen commented Jan 25, 2022

Thanks for reporting, have submitted PR.

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

Successfully merging a pull request may close this issue.

2 participants