fixed a NPE

This commit is contained in:
anthony 2011-07-06 16:07:20 -07:00
parent 90cb2dea6a
commit f1bee86263
1 changed files with 4 additions and 1 deletions

View File

@ -268,7 +268,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()) {