Prevent NPE in ListTasks
If the show-queue command is executed while an ls-projects command is executing, NPE occurs in the ListTasks REST API endpoint. Add a null check to prevent this. Bug: Issue 3211 Change-Id: Iea0ad5d1336d258ee2cd898eb5488ef610eb7d0c
This commit is contained in:
		@@ -124,7 +124,10 @@ public class ListTasks implements RestReadView<ConfigResource> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      if (task instanceof ProjectTask) {
 | 
					      if (task instanceof ProjectTask) {
 | 
				
			||||||
        ProjectTask<?> projectTask = ((ProjectTask<?>) task);
 | 
					        ProjectTask<?> projectTask = ((ProjectTask<?>) task);
 | 
				
			||||||
        this.projectName = projectTask.getProjectNameKey().get();
 | 
					        Project.NameKey name = projectTask.getProjectNameKey();
 | 
				
			||||||
 | 
					        if (name != null) {
 | 
				
			||||||
 | 
					          this.projectName = name.get();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        this.remoteName = projectTask.getRemoteName();
 | 
					        this.remoteName = projectTask.getRemoteName();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user