public List<NScreenModel> getNScreenModelsForDevice(Device device) {
List<NScreenModel> list = new LinkedList<NScreenModel>();
+ NScreenModel searchModel = null;
// add Common Model.
list.add(this.getCommonNscreen());
// add Orientation
if (device.getOrientation() != null) {
- list.add(getNScreenModel(NScreenType.ORIENTATION, device.getOrientation().toString()));
+ searchModel =
+ getNScreenModel(NScreenType.ORIENTATION, device.getOrientation().toString());
+ if (searchModel != null) {
+ list.add(searchModel);
+ }
}
// add pixel ratio
if (device.getDevicePixelRatio() > 0) {
- list.add(getNScreenModel(NScreenType.PIXELRATIO, device.getDevicePixelRatio()));
+ searchModel = getNScreenModel(NScreenType.PIXELRATIO, device.getDevicePixelRatio());
+ if (searchModel != null) {
+ list.add(searchModel);
+ }
+
}
// add Resolution