Fix issue with devices with no rooms or categories.

This commit is contained in:
Admin
2015-08-26 16:52:44 -05:00
parent 439b081bd5
commit bd60d63d0f

View File

@@ -57,8 +57,14 @@ public class VeraInfo {
Device theDevice = null;
while (theIterator.hasNext()) {
theDevice = theIterator.next();
theDevice.setRoom(roomMap.get(theDevice.getRoom()).getName());
theDevice.setCategory(categoryMap.get(theDevice.getCategory()).getName());
if(theDevice.getRoom() != null)
theDevice.setRoom(roomMap.get(theDevice.getRoom()).getName());
else
theDevice.setRoom("<unknown>");
if(theDevice.getCategory() != null)
theDevice.setCategory(categoryMap.get(theDevice.getCategory()).getName());
else
theDevice.setCategory("<unknown>");
}
ListIterator<Scene> theSecneIter = theSdata.getScenes().listIterator();