Merge "Check for null fd when constructing AssetFileDescriptor." into jb-dev

This commit is contained in:
Jeff Brown
2012-05-08 18:41:49 -07:00
committed by Android (Google) Code Review

View File

@@ -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");