am 8c680128: Merge "Check for null fd when constructing AssetFileDescriptor." into jb-dev
* commit '8c68012809ab9a1593f295463624774975bec1e1': Check for null fd when constructing AssetFileDescriptor.
This commit is contained in:
@@ -52,6 +52,9 @@ public class AssetFileDescriptor implements Parcelable {
|
||||
*/
|
||||
public AssetFileDescriptor(ParcelFileDescriptor fd, long startOffset,
|
||||
long length) {
|
||||
if (fd == null) {
|
||||
throw new IllegalArgumentException("fd must not be null");
|
||||
}
|
||||
if (length < 0 && startOffset != 0) {
|
||||
throw new IllegalArgumentException(
|
||||
"startOffset must be 0 when using UNKNOWN_LENGTH");
|
||||
|
||||
Reference in New Issue
Block a user