Fix NullPointerException caused by null-builder

Sometimes occurs java.lang.NullPointerException leading to app failed.
This commit is contained in:
SXY 2018-01-11 16:30:36 +08:00 committed by GitHub
parent fbbbf59c82
commit 9f8083c41c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -336,6 +336,7 @@ public class AllocateResponsePBImpl extends AllocateResponse {
@Override @Override
public synchronized void setNMTokens(List<NMToken> nmTokens) { public synchronized void setNMTokens(List<NMToken> nmTokens) {
maybeInitBuilder();
if (nmTokens == null || nmTokens.isEmpty()) { if (nmTokens == null || nmTokens.isEmpty()) {
if (this.nmTokens != null) { if (this.nmTokens != null) {
this.nmTokens.clear(); this.nmTokens.clear();