NSREEN: add null check in nscreenModelManager. 86/20986/1
authoryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Wed, 14 May 2014 10:13:47 +0000 (19:13 +0900)
committeryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Wed, 14 May 2014 10:13:47 +0000 (19:13 +0900)
getNscreenModelForDevice() searched NscreenModels.
return value check null.

Change-Id: I5f61b325c40c8d094d69cc9954f937a85de081d7
Signed-off-by: yonghwan82.jeon <yonghwan82.jeon@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/NScreenModelManager.java

index 3f37366..7cd5410 100644 (file)
@@ -157,18 +157,27 @@ public class NScreenModelManager {
 
     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