Handle NPE, this should resolve the crash during modify Tabs
This commit is contained in:
parent
3e383ce492
commit
22498415e6
|
@ -2656,12 +2656,14 @@ public final class Utils implements Constants, TwitterConstants {
|
|||
try {
|
||||
while (!cur.isAfterLast()) {
|
||||
final String consumerSecret = cur.getString(indices.consumer_secret);
|
||||
final byte[] consumerSecretBytes = consumerSecret.getBytes(Charset.forName("UTF-8"));
|
||||
crc32.update(consumerSecretBytes, 0, consumerSecretBytes.length);
|
||||
final long value = crc32.getValue();
|
||||
crc32.reset();
|
||||
for (final String keySecret : keySecrets) {
|
||||
if (Long.parseLong(keySecret, 16) == value) return true;
|
||||
if (consumerSecret != null) {
|
||||
final byte[] consumerSecretBytes = consumerSecret.getBytes(Charset.forName("UTF-8"));
|
||||
crc32.update(consumerSecretBytes, 0, consumerSecretBytes.length);
|
||||
final long value = crc32.getValue();
|
||||
crc32.reset();
|
||||
for (final String keySecret : keySecrets) {
|
||||
if (Long.parseLong(keySecret, 16) == value) return true;
|
||||
}
|
||||
}
|
||||
cur.moveToNext();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue