Merge pull request #867 in YUNIONIO/onecloud from ~QUXUAN/onecloud:hotfix/qx-nil-point to release/2.4.0

* commit '8cc586bf2a8708002eaf9ec082df11d38004b6d1':
  避免空指针引用
This commit is contained in:
邱剑
2019-01-02 14:51:43 +08:00
+2 -2
View File
@@ -1441,10 +1441,10 @@ func (self *SHost) SyncHostStorages(ctx context.Context, userCred mcclient.Token
if err != nil {
syncResult.AddError(err)
} else {
localStorages = append(localStorages, *local)
remoteStorages = append(remoteStorages, added[i])
syncResult.Add()
}
localStorages = append(localStorages, *local)
remoteStorages = append(remoteStorages, added[i])
}
return localStorages, remoteStorages, syncResult
}