fixed a NPE

This commit is contained in:
anthony 2011-07-06 16:07:20 -07:00
parent 79f5ece7dc
commit 67e2f130d0
1 changed files with 4 additions and 1 deletions

View File

@ -265,7 +265,10 @@ public class StatsCollector {
ConcurrentHashMap<Long, StorageStats> storageStats = new ConcurrentHashMap<Long, StorageStats>();
for (HostVO host : hosts) {
GetStorageStatsCommand command = new GetStorageStatsCommand(host.getStorageUrl());
HostVO ssAhost = _agentMgr.getSSAgent(host);
HostVO ssAhost = _agentMgr.getSSAgent(host);
if (ssAhost == null) {
return;
}
long hostId = host.getId();
Answer answer = _agentMgr.easySend(ssAhost.getId(), command);
if (answer != null && answer.getResult()) {