You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/04/19 08:23:48 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4924: protect against stray snapshot-details without snapshot

DaanHoogland commented on a change in pull request #4924:
URL: https://github.com/apache/cloudstack/pull/4924#discussion_r615641516



##########
File path: engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotDataFactoryImpl.java
##########
@@ -87,6 +87,9 @@ public SnapshotInfo getSnapshot(DataObject obj, DataStore store) {
     @Override
     public SnapshotInfo getSnapshot(long snapshotId, DataStoreRole role) {
         SnapshotVO snapshot = snapshotDao.findById(snapshotId);
+        if (snapshot == null) {
+            return null;
+        }

Review comment:
       i ran through the 20 call of getsnapshot(). I added some null checks but think they are superfluent. If we go on with this we should refactor the interface to include a specific exception.




-- 
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.

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