DaanHoogland commented on PR #8898:
URL: https://github.com/apache/cloudstack/pull/8898#issuecomment-2090367958

   sugestion by @vishesh92 :
   ```
   diff --git 
a/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
 
b/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
   index 492ec74382..30c0131be8 100644
   --- 
a/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
   +++ 
b/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
   @@ -97,6 +97,9 @@ public class TemplateDataFactoryImpl implements 
TemplateDataFactory {
        @Override
        public TemplateInfo getTemplate(long templateId, DataStore store) {
            VMTemplateVO templ = imageDataDao.findById(templateId);
   +        if (templ == null) {
   +            return null;
   +        }
            if (store == null && !templ.isDirectDownload()) {
                TemplateObject tmpl = TemplateObject.getTemplate(templ, null, 
null);
                return tmpl;
   ``


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to