mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge pull request #861 from zhaoyuguang/zhaoyuguang/dev_0
Optional value should only be accessed after calling isPresent()
This commit is contained in:
commit
e9c7778876
@ -157,7 +157,7 @@ public class OssStorageResource implements Resource {
|
||||
public Bucket getBucket() {
|
||||
return this.oss.listBuckets().stream()
|
||||
.filter(bucket -> bucket.getName().equals(this.bucketName)).findFirst()
|
||||
.get();
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user