NullPointerException in Cut and Paste feature

Is everything ok with copy+paste?

yes, copy+paste is working.

okay, thanks. I’ll fix this issue tonight.

no problem. Have a good day.

I noticed that cut+paste also works, but probably a bit unexpectedly.

If you create three tasks:

task1
task2
task3

cut task3, select task1 and paste, task 3 moves between task1 and task2. That is, it moves the cut task so that it becomes a sibling of the selected task, not a child (which is probably expected). Is it the same on your side?

It’s the same on my side, but the move will be visable after reopening the project, not immediately.

task1
task2
task3

Thats the view after cutting and pasting

and here after reopening
task1
task3
task2

That’s strange. Is everything okay with drag’n’drop?

drag’n’drop is ok. after Moving task3 to task 1, it appears below task1:

image

Related issue: Where is the subtask?

Filed a new ticket to the issue tracker: The task tree won't update properly after clipboard operations · Issue #2050 · bardsoftware/ganttproject · GitHub

Can you please test if the update 3222 fixes this issue?
You can download a ZIP file from this link update-3222.zip

You need to unpack this ZIP archive into .ganttproject.d/updates folder in your user home directory so that the result file structure looked like this:

.ganttproject.d/updates/
└── update-3222
    ├── ganttproject
    └── VERSION
.... other updates

Make sure that all the previous updates suggested by the Updater are installed.
GP 3.2 is expected to show version 3222 in the About dialog.

Cut and paste now ok. But after undo of this action the original task has been disappeared.

Is it true that the second undo will get it back? It seems that the first undo rolls back “paste” and the second rolls back “cut” action.

Yes, can confirm same behavior

Can you please try this update 3223? It should fix undo. Instructions are the same.

https://www.dropbox.com/s/ux1qyw7m60yh1el/update-3223.zip?dl=1

Undo is working as expected. Thanks a lot.

I’m having the problem that initial poster is having where a copy is failing and logging the following failure in the log:
java.io.IOException: Failed to save the project file
at net.sourceforge.ganttproject.io.GanttXMLSaver.save(GanttXMLSaver.java:116)
at net.sourceforge.ganttproject.GPTransferable.createDocumentFlavor(GPTransferable.java:94)

ganttproject.log (6.4 KB)

You probably need to install update 3240.
I am not sure why this fails, because the bug was fixed in 3230, which you seem to be using. Try installing 3240 anyway.