Merge "Don\'t call .toString() on potentially null CharSequence" into nyc-dev am: b182735757

am: 7317034daf

* commit '7317034daf526553ef3ad7052d994b17820fd9e3':
  Don't call .toString() on potentially null CharSequence

Change-Id: I7a9bea266fa3748e212384165623acc561fa2a81
This commit is contained in:
Chris Tate
2016-05-28 01:04:50 +00:00
committed by android-build-merger

View File

@@ -292,8 +292,10 @@ public class ResourcesImpl {
return mAssets.openNonAsset(value.assetCookie, value.string.toString(),
AssetManager.ACCESS_STREAMING);
} catch (Exception e) {
NotFoundException rnf = new NotFoundException("File " + value.string.toString() +
" from drawable resource ID #0x" + Integer.toHexString(id));
// Note: value.string might be null
NotFoundException rnf = new NotFoundException("File "
+ (value.string == null ? "(null)" : value.string.toString())
+ " from drawable resource ID #0x" + Integer.toHexString(id));
rnf.initCause(e);
throw rnf;
}