Fixes DriveBakedModel to not crash when SLOT_STATE is null (#3545)

Uses a null object in case the TE is not available for whichever reason.
This commit is contained in:
fscan
2018-06-18 19:03:28 +02:00
committed by yueh
parent 0ef854ca4b
commit b431d5d681
2 changed files with 11 additions and 6 deletions
@@ -75,4 +75,14 @@ public class DriveSlotsState
}
return new DriveSlotsState( slots );
}
public static DriveSlotsState createEmpty( int slotCount )
{
DriveSlotState[] slots = new DriveSlotState[slotCount];
for( int i = 0; i < slotCount; i++ )
{
slots[i] = DriveSlotState.EMPTY;
}
return new DriveSlotsState( slots );
}
}