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

am: b182735757

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

Change-Id: I5c8253739fa06b07abd4d67b4947c6bed153d010
This commit is contained in:
Christopher Tate
2016-05-28 00:57:43 +00:00
committed by android-build-merger

View File

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