mark some getText methods as nullable and avoid related issues

fixes one of the crashes in #723
This commit is contained in:
Helium314 2024-04-19 21:46:13 +02:00
parent 9a893d8e22
commit da467a6751
3 changed files with 19 additions and 18 deletions

View file

@ -2131,7 +2131,8 @@ public final class InputLogic {
if (settingsValues.mUrlDetectionEnabled && settingsValues.mSpacingAndPunctuations.containsSometimesWordConnector(mWordComposer.getTypedWord()))
return true;
// "://" before typed word -> very much looks like URL
if (mConnection.getTextBeforeCursor(mWordComposer.getTypedWord().length() + 3, 0).toString().startsWith("://"))
final CharSequence textBeforeCursor = mConnection.getTextBeforeCursor(mWordComposer.getTypedWord().length() + 3, 0);
if (textBeforeCursor != null && textBeforeCursor.toString().startsWith("://"))
return true;
return false;
}