From 4d0598a011962fc80eb0190e96b74edd8d30f098 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 18 Aug 2024 21:24:32 +0200 Subject: [PATCH] Fix crash when clipboard contains an image --- srcs/juloo.keyboard2/ClipboardHistoryService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srcs/juloo.keyboard2/ClipboardHistoryService.java b/srcs/juloo.keyboard2/ClipboardHistoryService.java index e3f01ba..2c83ba6 100644 --- a/srcs/juloo.keyboard2/ClipboardHistoryService.java +++ b/srcs/juloo.keyboard2/ClipboardHistoryService.java @@ -145,7 +145,11 @@ public final class ClipboardHistoryService return; int count = clip.getItemCount(); 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