diff options
author | Dan Albert <danalbert@google.com> | 2014-09-08 18:34:29 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-09-08 18:34:29 -0700 |
commit | a8995adc2b363811482c38009f64992b322efaad (patch) | |
tree | 37cb7d31ea9614a7f4c200c14bc36125d789f083 /tools/aapt/Command.cpp | |
parent | f4eaaadb8cb0e2ff8d1704827883b5a62173311d (diff) | |
download | frameworks_base-a8995adc2b363811482c38009f64992b322efaad.zip frameworks_base-a8995adc2b363811482c38009f64992b322efaad.tar.gz frameworks_base-a8995adc2b363811482c38009f64992b322efaad.tar.bz2 |
Don't check for null references.
The address of a reference will never be null in well formed C++ code.
The function returning the value being checked simply returns a
dereferenced pointer (which is just going to segfault if it is null!).
Change-Id: I3a4eb6adfc003c63ebf21b81d46088d52154d99d
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r-- | tools/aapt/Command.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index f7de558..93dc5c9 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -197,14 +197,10 @@ int doList(Bundle* bundle) } const ResTable& res = assets.getResources(false); - if (&res == NULL) { - printf("\nNo resource table found.\n"); - } else { #ifndef HAVE_ANDROID_OS - printf("\nResource table:\n"); - res.print(false); + printf("\nResource table:\n"); + res.print(false); #endif - } Asset* manifestAsset = assets.openNonAsset("AndroidManifest.xml", Asset::ACCESS_BUFFER); @@ -531,11 +527,6 @@ int doDump(Bundle* bundle) assets.setConfiguration(config); const ResTable& res = assets.getResources(false); - if (&res == NULL) { - fprintf(stderr, "ERROR: dump failed because no resource table was found\n"); - goto bail; - } - if (strcmp("resources", option) == 0) { #ifndef HAVE_ANDROID_OS res.print(bundle->getValues()); |