leehaut opened a new issue, #9213:
URL: https://github.com/apache/hop/issues/9213
### Apache Hop version?
2.21.0-SNAPSHOT
### Java version?
openjdk 21
### Operating system
Windows
### What happened?
## Description
In Hop GUI, pressing **Ctrl+V** when the system clipboard has no text
content(for example after copying a file in the OS file manager, which uses a
file transfer type rather than text) causes a `NullPointerException` in the
workflow / pipeline paste handlers.
## Steps to reproduce
1. Open a workflow or pipeline in Hop GUI.
2. Copy a file in the OS file explorer (Ctrl+C), **or** leave the text
clipboard empty.
3. Focus Hop GUI and press Ctrl+V (paste).
4. Observe an error dialog / stack trace with NPE.
Optional (File Explorer):
1. Open the File Explorer perspective.
2. Select a file and press Ctrl+C, then Ctrl+V on a folder.
3. Observe the same NPE (or confusing paste behavior) instead of guidance
to use drag and drop.
## Expected behavior
- Workflow / pipeline: if clipboard text is `null` or empty, paste should be
a no-op (no paste, no dialog, no NPE). Valid Hop clipboard content (actions,
transforms, notes, etc.) must still paste normally.
- File Explorer: Ctrl+C / Ctrl+V should show an informational message that
file copy/paste via clipboard is not supported, and that files should be
dragged onto the target folder.
## Actual behavior
```txt
java.lang.NullPointerException: Cannot invoke "String.startsWith(String)"
because "clipboardContent" is null
at
org.apache.hop.ui.hopgui.file.workflow.delegates.HopGuiWorkflowClipboardDelegate.pasteNoXmlContent(HopGuiWorkflowClipboardDelegate.java:205)
at
org.apache.hop.ui.hopgui.file.workflow.delegates.HopGuiWorkflowClipboardDelegate.pasteXml(HopGuiWorkflowClipboardDelegate.java:194)
at
org.apache.hop.ui.hopgui.file.workflow.HopGuiWorkflowGraph.pasteFromClipboard(HopGuiWorkflowGraph.java:3293)
at org.apache.hop.ui.hopgui.HopGui.menuEditPaste(HopGui.java:1806)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at
org.apache.hop.ui.hopgui.HopGuiKeyHandler.handleKey(HopGuiKeyHandler.java:456)
at
org.apache.hop.ui.hopgui.HopGuiKeyHandler.keyPressed(HopGuiKeyHandler.java:302)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:209)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4363)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1217)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1241)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1226)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1268)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1264)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1747)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:5087)
at org.eclipse.swt.widgets.Tree.WM_CHAR(Tree.java:6108)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4964)
at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:6103)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5131)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3747)
at org.apache.hop.ui.hopgui.HopGui.open(HopGui.java:899)
at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:714)
```
### Issue Priority
Priority: 3
### Issue Component
Component: Hop Gui
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]