diff --git a/src/sdk/namespace_blob.js b/src/sdk/namespace_blob.js index 92e689aaab..f718162e48 100644 --- a/src/sdk/namespace_blob.js +++ b/src/sdk/namespace_blob.js @@ -747,6 +747,7 @@ class NamespaceBlob { size, etag, create_time: flat_obj.lastModified, + last_modified_time: flat_obj.lastModified, content_type: flat_obj.contentType, xattr: modified_xattr, tag_count: tag_count, diff --git a/src/sdk/namespace_cache.js b/src/sdk/namespace_cache.js index 8e2fe59dc7..56af49caf2 100644 --- a/src/sdk/namespace_cache.js +++ b/src/sdk/namespace_cache.js @@ -683,6 +683,9 @@ class NamespaceCache { async_get_last_modified_time: async () => { const upload_res = await hub_promise; const last_modified_time = (new Date(upload_res.last_modified_time)).getTime(); + if (isNaN(last_modified_time)) { + throw new Error('Invalid last_modified_time returned from hub_promise, Expected a valid date or timestamp.'); + } return last_modified_time; }, upload_chunks_hook: this.update_cache_stats_hook(params.bucket),