Skip to content

Commit

Permalink
sync: onedrive: Gracefully handle a missing modtime
Browse files Browse the repository at this point in the history
Return a 0 modtime instead of throwing an exception if the field is missing.  It
hasn't been missing in practice (so far), but a 0 return is better than a crash.
  • Loading branch information
jefftharris committed Dec 31, 2024
1 parent 5fbbcdf commit fd42018
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public String getFolder()
@Override
public long getModTime()
{
var modtime = Objects.requireNonNull(itsItem.getLastModifiedDateTime());
return modtime.toInstant().toEpochMilli();
var modtime = itsItem.getLastModifiedDateTime();
return (modtime != null) ? modtime.toInstant().toEpochMilli() : 0;
}

/**
Expand Down

0 comments on commit fd42018

Please sign in to comment.