Skip to content
Snippets Groups Projects
Commit 2fe73a62 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XWIKI-22365: Possible nullpointerexception when getting the extension index status

parent abb49691
No related branches found
No related tags found
No related merge requests found
......@@ -165,7 +165,7 @@ public ExtensionIndexStatus getStatus(Namespace namespace)
ExtensionIndexStatus scheduledStatus = !id.equals(this.scheduledRequest.getId())
? (ExtensionIndexStatus) this.jobStore.getJobStatus(this.scheduledRequest.getId()) : null;
if (namespaceStatus != null
if (hasAStartDate(namespaceStatus)
&& (scheduledStatus == null || namespaceStatus.getStartDate().after(scheduledStatus.getStartDate())
|| !((ExtensionIndexRequest) scheduledStatus.getRequest()).getNamespaces().contains(namespace))) {
return namespaceStatus;
......@@ -174,6 +174,11 @@ public ExtensionIndexStatus getStatus(Namespace namespace)
return scheduledStatus;
}
private boolean hasAStartDate(ExtensionIndexStatus status)
{
return status != null && status.getStartDate() != null;
}
/**
* @param namespace the new namespace to analyze
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment