Skip to content

Commit 93a950e

Browse files
Mikep86davidkyle
andauthored
[ML] Avoid potentially throwing calls to Task#getDescription in model download (#124554)
(cherry picked from commit 444b8ea) Co-authored-by: David Kyle <[email protected]>
1 parent 425b095 commit 93a950e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/changelog/124527.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 124527
2+
summary: Avoid potentially throwing calls to Task#getDescription in model download
3+
area: Machine Learning
4+
type: bug
5+
issues: []

x-pack/plugin/ml-package-loader/src/main/java/org/elasticsearch/xpack/ml/packageloader/action/TransportLoadTrainedModelPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ synchronized boolean handleDownloadInProgress(
151151

152152
ModelDownloadTask inProgress = null;
153153
for (var task : tasks) {
154-
if (description.equals(task.getDescription()) && task instanceof ModelDownloadTask downloadTask) {
154+
if (task instanceof ModelDownloadTask downloadTask && (description.equals(downloadTask.getDescription()))) {
155155
inProgress = downloadTask;
156156
break;
157157
}

0 commit comments

Comments
 (0)