Skip to content

Commit 334bcb3

Browse files
committed
fix oss list in some certain condition
1 parent 29cfb5a commit 334bcb3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ecosystem/oss.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,14 @@ int OssClient::walk_list_results(const SimpleDOM::Node& list_bucket_result,
509509
auto type = NodeStrValue(child["Type"]);
510510

511511
if (!key.has_value() || !size.has_value() || !mtime.has_value() ||
512-
!etag.has_value() || !type.has_value())
512+
!etag.has_value())
513513
LOG_ERROR_RETURN(EINVAL, -1,
514514
"unexpected response: missing required fields");
515515

516+
estring_view type_sv = type.has_value() ? static_cast<estring_view>(type) : estring_view();
517+
516518
auto mtim = get_list_lastmodified(mtime);
517-
auto r = cb({key, etag, type, static_cast<size_t>(size), mtim,
519+
auto r = cb({key, etag, type_sv, static_cast<size_t>(size), mtim,
518520
false /*not comm prefix*/});
519521
if (r < 0) return r;
520522
}

0 commit comments

Comments
 (0)