Skip to content

Commit f09b851

Browse files
committed
fix:fix gitee branch is null will appear 404 error
1 parent 6c580a4 commit f09b851

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/utils/strategy/impl/gitee_image_upload.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ class GiteeImageUpload implements ImageUploadStrategy {
2727
if (info != null) {
2828
String realUrl =
2929
path.joinAll(['repos', info.ownerrepo, 'contents', info.path]);
30-
await GiteeApi.deleteFile(realUrl, {
30+
Map<String, dynamic> mapData = {
3131
"message": DELETE_COMMIT_MESSAGE,
3232
"sha": info.sha,
33-
"branch": info.branch
34-
});
33+
};
34+
if (!isBlank(info.branch)) {
35+
mapData["branch"] = info.branch;
36+
}
37+
await GiteeApi.deleteFile(realUrl, mapData);
3538
}
3639
return uploaded;
3740
}

0 commit comments

Comments
 (0)