Skip to content

Commit cd9530d

Browse files
committed
Add log for null templateVO
1 parent 8dcfc7c commit cd9530d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ public TemplateInfo getReadyBypassedTemplateOnManagedStorage(long templateId, Te
296296
@Override
297297
public boolean isTemplateMarkedForDirectDownload(long templateId) {
298298
VMTemplateVO templateVO = imageDataDao.findById(templateId);
299+
if (templateVO == null) {
300+
throw new CloudRuntimeException(String.format("Template not found with ID: %s", templateId));
301+
}
299302
return templateVO.isDirectDownload();
300303
}
301304
}

0 commit comments

Comments
 (0)