Skip to content

Commit

Permalink
improve argument check
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Oct 4, 2023
1 parent 4166618 commit 5471283
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/java/src/org/lucee/extension/resource/s3/S3.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public Bucket createDirectory(String bucketName, Object acl, String targetRegion
}
}
if (!Util.isEmpty(targetRegion)) throw new S3Exception("could not create bucket [" + bucketName + "] with defined region [" + targetRegion + "]", ase);
throw new S3Exception("could not create bucket [" + bucketName + "] with region [" + region + "]", ase);
if (!Util.isEmpty(region)) throw new S3Exception("could not create bucket [" + bucketName + "] with region [" + region + "]", ase);
throw new S3Exception("could not create bucket [" + bucketName + "]", ase);
}
finally {
client.release();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class S3GetACL extends S3Function {
public Object invoke(PageContext pc, Object[] args) throws PageException {
CFMLEngine eng = CFMLEngineFactory.getInstance();
Cast cast = eng.getCastUtil();
if (args.length > 6 || args.length < 3) throw eng.getExceptionUtil().createFunctionException(pc, "S3GetACL", 3, 6, args.length);
if (args.length > 6 || args.length < 2) throw eng.getExceptionUtil().createFunctionException(pc, "S3GetACL", 1, 6, args.length);

// required
String bucketName = cast.toString(args[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class S3GetMetaData extends S3Function {
public Object invoke(PageContext pc, Object[] args) throws PageException {
CFMLEngine eng = CFMLEngineFactory.getInstance();
Cast cast = eng.getCastUtil();
if (args.length > 6 || args.length < 3) throw eng.getExceptionUtil().createFunctionException(pc, "S3GetMetaData", 3, 6, args.length);
if (args.length > 6 || args.length < 2) throw eng.getExceptionUtil().createFunctionException(pc, "S3GetMetaData", 1, 6, args.length);

// required
String bucketName = cast.toString(args[0]);
Expand Down

0 comments on commit 5471283

Please sign in to comment.