Skip to content

Commit 38a9204

Browse files
committed
catch null pointer from src data object get size for now
1 parent 65646b7 commit 38a9204

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ private Scope pickCacheScopeForCopy(DataObject srcData, DataObject destData) {
147147

148148
protected Answer copyObject(DataObject srcData, DataObject destData, Host destHost) {
149149
long dataSize = 0;
150-
if(srcData != null){
150+
try{
151151
dataSize = srcData.getSize();
152+
}catch(NullPointerException e){
153+
s_logger.error("Unable to determine size of src data object with uuid: " + srcData.getUuid(),e);
152154
}
153155
int imgSizeGigs = (int)Math.ceil(dataSize * 1.0d / (1024 * 1024 * 1024));
154156
imgSizeGigs++; // add one just in case

0 commit comments

Comments
 (0)