summaryrefslogtreecommitdiff
path: root/platform/android/java/lib
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-29 00:30:30 +0200
committerGitHub <noreply@github.com>2022-04-29 00:30:30 +0200
commitcbdc33bcf73090962e60c1cf5ee50a21b29e4bad (patch)
treea78d03623e2b2a26607c3427ce2c227bbe050801 /platform/android/java/lib
parent574bf0b91b848e6369d0a07a611d4decf88e668b (diff)
parent5924e2b90e52b366813e985b6bcf28129b0f8f60 (diff)
Merge pull request #60563 from madmiraal/fix-60562
Diffstat (limited to 'platform/android/java/lib')
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/Godot.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java
index 351e2e60a0..377881be85 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java
@@ -666,14 +666,13 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
public String getClipboard() {
- String copiedText = "";
-
- if (mClipboard.hasPrimaryClip()) {
- ClipData.Item item = mClipboard.getPrimaryClip().getItemAt(0);
- copiedText = item.getText().toString();
- }
-
- return copiedText;
+ ClipData clipData = mClipboard.getPrimaryClip();
+ if (clipData == null)
+ return "";
+ CharSequence text = clipData.getItemAt(0).getText();
+ if (text == null)
+ return "";
+ return text.toString();
}
public void setClipboard(String p_text) {