Gantt crashes with specific Project start dates

0 votes
asked Sep 25, 2023 in Bug by Zian_vW (120 points)

Tool crashes with weekly printscale and project start date between 2023/9/25 and 2023/9/29

@startgantt

printscale weekly
project starts 2023/9/29

[Test] lasts 1 day

@endgantt
commented Sep 25, 2023 by albert (3,520 points)
Looks like the problem here is the fact that the printscale is set to weekly but the project only lasts 1 day (also happens for other dates), but still the crash shouldn't happen.

1 Answer

0 votes
answered Sep 25, 2023 by anonymous

My comment about some dates working came from a more extensive example.  After I stripped it down to a minimal test case, I did not realize that it also stopped working for dates that had previously worked.

I first had this:

@startgantt

printscale weekly
saturdays are closed
sundays are closed

project starts 2023/9/25

[Test] lasts 1 day

@endgantt

Here, if I change the project start date to 2023/9/24, it works, but 2023/9/25 to 2023/9/29 does not.  It seems that if I put the project start date on a day for which I've said something (Saturday and Sunday being closed, in this example), then it works, otherwise not.

commented Sep 25, 2023 by The-Lu (64,760 points)

[For the PlantUML team here is the error stack

 RootCause java.lang.NullPointerException   
 java.lang.NullPointerException 
   net.sourceforge.plantuml.project.draw.TimeHeaderWeekly.printMonth(TimeHeaderWeekly.java:140) 
   net.sourceforge.plantuml.project.draw.TimeHeaderWeekly.printMonths(TimeHeaderWeekly.java:106)
   net.sourceforge.plantuml.project.draw.TimeHeaderWeekly.drawCalendar(TimeHeaderWeekly.java:86)
   net.sourceforge.plantuml.project.draw.TimeHeaderWeekly.drawTimeHeader(TimeHeaderWeekly.java:70)  
   net.sourceforge.plantuml.project.GanttDiagram$1.drawU(GanttDiagram.java:246) 
   net.atmp.ImageBuilder.writeImageInternal(ImageBuilder.java:306)  
   net.atmp.ImageBuilder.write(ImageBuilder.java:256)   
   net.sourceforge.plantuml.project.GanttDiagram.exportDiagramNow(GanttDiagram.java:177)
   net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:207)   

]

commented Nov 27, 2023 by plantuml (295,000 points)

Thanks for the feedback.

This is now fixed!

Still, the drawing is ugly :-)

...