skin: remove null pointer dereferences 58/15458/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Tue, 21 Jan 2014 02:18:14 +0000 (11:18 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Tue, 21 Jan 2014 11:05:38 +0000 (20:05 +0900)
Change-Id: I420cef201f172ca88aa06431aba3e63bcb44182c
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java
tizen/src/skin/client/src/org/tizen/emulator/skin/menu/PopupMenu.java

index 6f7a786..b4f9455 100644 (file)
@@ -119,12 +119,14 @@ public class SkinLogger {
 
                        /* delete .lck files after abnormal skin termination */
                        File[] listFiles = dir.listFiles();
-                       for (File f : listFiles) {
-                               String name = f.getName();
-
-                               if (!FILE_NAME.equals(name) && name.startsWith(FILE_NAME)) {
-                                       if (f.delete() == false) {
-                                               /* do nothing */
+                       if (listFiles != null) {
+                               for (File f : listFiles) {
+                                       String name = f.getName();
+
+                                       if (!FILE_NAME.equals(name) && name.startsWith(FILE_NAME)) {
+                                               if (f.delete() == false) {
+                                                       /* do nothing */
+                                               }
                                        }
                                }
                        }
index 33b114b..5044200 100644 (file)
@@ -538,7 +538,7 @@ public class PopupMenu {
                        };
 
                        File[] layoutPaths = pathRoot.listFiles(filter);
-                       if (layoutPaths.length <= 0) {
+                       if (layoutPaths == null || layoutPaths.length <= 0) {
                                logger.info("the layout of key window not found");
                                return null;
                        }