YARN-5048. DelegationTokenRenewer#skipTokenRenewal may throw NPE (Jian He via Yongjun Zhang)
(cherry picked from commit 47c41e7ac7
)
This commit is contained in:
parent
8653bcbe67
commit
5ae5b869aa
|
@ -539,9 +539,14 @@ public class DelegationTokenRenewer extends AbstractService {
|
||||||
*/
|
*/
|
||||||
private boolean skipTokenRenewal(Token<?> token)
|
private boolean skipTokenRenewal(Token<?> token)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Text renewer = ((Token<AbstractDelegationTokenIdentifier>)token).
|
AbstractDelegationTokenIdentifier identifier =
|
||||||
decodeIdentifier().getRenewer();
|
((Token<AbstractDelegationTokenIdentifier>) token).decodeIdentifier();
|
||||||
|
if (identifier == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Text renewer = identifier.getRenewer();
|
||||||
return (renewer != null && renewer.toString().equals(""));
|
return (renewer != null && renewer.toString().equals(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue