mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
avoid with NPE when no selection
This commit is contained in:
@@ -1580,13 +1580,14 @@ public class JEditTextArea extends JComponent
|
||||
Clipboard clipboard = getToolkit().getSystemClipboard();
|
||||
|
||||
String selection = getSelectedText();
|
||||
if (selection != null) {
|
||||
int repeatCount = inputHandler.getRepeatCount();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0; i < repeatCount; i++)
|
||||
sb.append(selection);
|
||||
|
||||
int repeatCount = inputHandler.getRepeatCount();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0; i < repeatCount; i++)
|
||||
sb.append(selection);
|
||||
|
||||
clipboard.setContents(new StringSelection(sb.toString()), null);
|
||||
clipboard.setContents(new StringSelection(sb.toString()), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user