You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.NullPointerException
at jfxtras.icalendarfx.VParentBase.checkChild(VParentBase.java:370)
at jfxtras.icalendarfx.VParentBase.addChildInternal(VParentBase.java:397)
at jfxtras.icalendarfx.VParentBase.parseContent(VParentBase.java:305)
at jfxtras.icalendarfx.VParentBase.parseContent(VParentBase.java:283)
at jfxtras.icalendarfx.VCalendar.parse(VCalendar.java:956)
at TestVCalendar.main(TestVCalendar.java:18)
I also make a workaround in VParentBase.checkChild. The variable getter is null in this case. I have Move the part below if ( !isChildAllowed )to an else block. Now it is ok for me.
Here is the complete method:
protectedbooleancheckChild( List<Message> messages, Stringcontent, StringelementName, VChildnewChild )
{
intinitialMessageSize = messages.size();
if ( newChild == null )
{
Messagemessage = newMessage( this,
"Ignored invalid element:" + content,
MessageEffect.MESSAGE_ONLY );
messages.add( message );
}
Methodgetter = getGetter( newChild );
booleanisChildAllowed = getter != null;
if ( !isChildAllowed )
{
Messagemessage = newMessage( this,
elementName + " not allowed in " + name(),
MessageEffect.THROW_EXCEPTION );
messages.add( message );
}
else// Moved to an else block, because getter could be null here
{
finalbooleanisChildAlreadyPresent;
ObjectcurrentParameter = null;
try
{
currentParameter = getter.invoke( this );
}
catch ( IllegalAccessException | IllegalArgumentException | InvocationTargetExceptione )
{
e.printStackTrace();
}
if ( currentParameterinstanceofCollection )
{
isChildAlreadyPresent = ( (Collection<?>)currentParameter ).contains( newChild ); // TODO contains is expensive - try to find a way to avoid
}
else
{
isChildAlreadyPresent = currentParameter != null;
}
if ( isChildAlreadyPresent )
{
Messagemessage = newMessage( this,
newChild.getClass().getSimpleName() + " can only occur once in a calendar component. Ignoring instances beyond first.",
MessageEffect.MESSAGE_ONLY );
messages.add( message );
}
}
returnmessages.size() == initialMessageSize;
}
What do you think of this solution?
The text was updated successfully, but these errors were encountered:
Hi,
I tried to read a calendar but get an error:
.
Here is my test case:
I also make a workaround in VParentBase.checkChild. The variable getter is null in this case. I have Move the part below if ( !isChildAllowed )to an else block. Now it is ok for me.
Here is the complete method:
What do you think of this solution?
The text was updated successfully, but these errors were encountered: