-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fix range bound crash when startIndex greater than or equal to endIndex #122
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #122 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 21 21
Lines 975 976 +1
=====================================
+ Hits 975 976 +1
Continue to review full report at Codecov.
|
Can you please add a test that presents the issue and proves the fix. |
Hi szweier, I was trying to reproduce the issue in this sample project, however I am still unable to reproduce it by using the test project. The crash is happened to my project with following steps:
After I have added the checking to the code to prevent the upper bound value lower than the lower bound value then it solved the issue. I am still trying to make this happen to the test project in this library, but I have no luck to make it happen. |
@wonderhero I'm having a hard time reproducing this. Can you tell me the exact text you have in the field and where you move the cursor that triggers the issue. I'm assuming it's something along the lines of |
@szweier thank you for your great helper. I am trying to get you the exact text that I have input to the field and causing the crash. Text that I have been using: However, I could not reproduce by using the test project in this library. I doubt the crash is due to the cursor is moving to a location where it is opening the mention selector and also due to some other extra workflow (on text view) that defined in my working project. It is when I point my cursor to behind of first smiley in text above and crash happen when opening the mention selector. Sorry for unable to provide a promising test case for you. I will keep trying and update you again. |
Thanks. Is your project where the issue is happening public? |
@szweier currently working in a private repo for my company. |
@wonderhero can you try using the changes in https://github.com/szweier/SZMentionsSwift/pull/130/files in your private repo. I just came across this issue when using your example above and while I can't reproduce the problem you describe I did find an issue that needs to be fixed and thought it might help avoid hitting the issue you have. |
@szweier I have tried in my private repo, the issue still persists. I am currently trying to use the example in this library to reproduce the issue. Trying to compare the difference between my projects. |
Range bound will crash when startIndex greater than or equal to endIndex in some case.