kitodo / kitodo-production

Kitodo.Production is a workflow management tool for mass digitization and is part of the Kitodo Digital Library Suite.
http://www.kitodo.org/software/kitodoproduction/
GNU General Public License v3.0
63 stars 63 forks source link

NPE when creating an Issue #3229

Closed Kathrin-Huber closed 4 years ago

Kathrin-Huber commented 4 years ago

Sometimes (not yet determined when exactly) a NPE occurs, when creating an Issue

 java.lang.NullPointerException
    at org.kitodo.production.model.bibliography.course.IndividualIssue.getBreakMark(IndividualIssue.java:116)
    at org.kitodo.production.model.bibliography.course.Course.splitInto(Course.java:771)
    at org.kitodo.production.forms.CalendarForm.setGranularity(CalendarForm.java:168)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at javax.el.BeanELResolver.setValue(BeanELResolver.java:122)

It also occurs when clicking the granularity buttons on the second tab. (Same Stack Trace)

Kathrin-Huber commented 4 years ago

The problem seems to be an empty granularity default selection. When navigating to the second tab the first time, there is no granularity selected. In further steps this leads to a NPE. granularity

solth commented 4 years ago

I can't reproduce the error. When navigating to the granularity tab for the first time, the "Issues" granularity is correctly preselected, which corresponds to https://github.com/kitodo/kitodo-production/blob/21515d33a81ba59aa418713f42862b714189f8d4/Kitodo/src/main/java/org/kitodo/production/forms/CalendarForm.java#L91

Bildschirmfoto 2020-02-25 um 16 21 32
Kathrin-Huber commented 4 years ago

I could also not reproduce it