- int w = Integer.parseInt (cursor.getString(width_col));
- int h = Integer.parseInt (cursor.getString(height_col));
- if (type.startsWith("image/") &&
- w > min_size && h > min_size &&
- w < max_size && h < max_size) {
- imgs.add (path);
+ if (path != null && type != null && type.startsWith("image/")) {
+ String wc = cursor.getString(width_col);
+ String hc = cursor.getString(height_col);
+ if (wc != null && hc != null) {
+ int w = Integer.parseInt (wc);
+ int h = Integer.parseInt (hc);
+ if (w > min_size && h > min_size &&
+ w < max_size && h < max_size) {
+ imgs.add (path);
+ }
+ }