mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added check for String format. (#198)
This commit is contained in:
@@ -122,10 +122,15 @@ public abstract class AbstractReplicationWebscript extends DeclarativeWebScript
|
|||||||
|
|
||||||
if(schedule.has("start") && !schedule.isNull("start")) {
|
if(schedule.has("start") && !schedule.isNull("start")) {
|
||||||
// Look for start:.... or start:{"iso8601":....}
|
// Look for start:.... or start:{"iso8601":....}
|
||||||
String startDate = schedule.getString("start");
|
String startDate = null;
|
||||||
if(schedule.get("start") instanceof JSONObject) {
|
if (schedule.get("start") instanceof String)
|
||||||
|
{
|
||||||
|
startDate = schedule.getString("start");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
startDate = schedule.getJSONObject("start").getString("iso8601");
|
startDate = schedule.getJSONObject("start").getString("iso8601");
|
||||||
}
|
}
|
||||||
|
|
||||||
replicationDefinition.setScheduleStart( ISO8601DateFormat.parse(startDate) );
|
replicationDefinition.setScheduleStart( ISO8601DateFormat.parse(startDate) );
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user