sureshanaparti commented on code in PR #13023:
URL: https://github.com/apache/cloudstack/pull/13023#discussion_r3115313321


##########
engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java:
##########
@@ -295,10 +298,16 @@ public void handleSysTemplateDownload(HypervisorType 
hostHyper, Long dcId) {
     }
 
     protected boolean shouldDownloadTemplateToStore(VMTemplateVO template, 
DataStore store) {
+        if (dataStoreDao.findById(store.getId()).isReadonly()) {

Review Comment:
   ```suggestion
           ImageStoreVO storeVO = imageStoreDao.findById(store.getId());
           if (storeVO == null) {
               // add log
               return false;
           }
           
           if (storeVO.isReadonly()) {
   ```
   
   npe for removed image store, can check store exists before _isReadonly()_
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to