Merge pull request #60563 from madmiraal/fix-60562

This commit is contained in:
Rémi Verschelde 2022-04-29 00:30:30 +02:00 committed by GitHub
commit cbdc33bcf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {