Fix crash when clipboard contains an image

This commit is contained in:
Jules Aguillon 2024-08-18 21:24:32 +02:00
parent 038f693cae
commit 4d0598a011

View File

@ -145,7 +145,11 @@ public final class ClipboardHistoryService
return; return;
int count = clip.getItemCount(); int count = clip.getItemCount();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
add_clip(clip.getItemAt(i).getText().toString()); {
CharSequence text = clip.getItemAt(i).getText();
if (text != null)
add_clip(text.toString());
}
} }
final class SystemListener implements ClipboardManager.OnPrimaryClipChangedListener final class SystemListener implements ClipboardManager.OnPrimaryClipChangedListener