[ML] Avoid potentially throwing calls to Task#getDescription in model download

This commit is contained in:
David Kyle 2025-03-11 09:48:07 +00:00 committed by GitHub
parent c26d195120
commit 444b8eab75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
pr: 124527
summary: Avoid potentially throwing calls to Task#getDescription in model download
area: Machine Learning
type: bug
issues: []

View file

@ -151,7 +151,7 @@ public class TransportLoadTrainedModelPackage extends TransportMasterNodeAction<
ModelDownloadTask inProgress = null;
for (var task : tasks) {
if (description.equals(task.getDescription()) && task instanceof ModelDownloadTask downloadTask) {
if (task instanceof ModelDownloadTask downloadTask && (description.equals(downloadTask.getDescription()))) {
inProgress = downloadTask;
break;
}