From 3f0c84f9be0bb3a2cd1581b67940c398acb112e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be>
Date: Thu, 25 Aug 2016 17:49:14 +0200
Subject: [PATCH] Cleaned a bit Exception use in IconTheme

---
 include/class_IconTheme.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/class_IconTheme.inc b/include/class_IconTheme.inc
index 1d10ed5de..c6834a461 100644
--- a/include/class_IconTheme.inc
+++ b/include/class_IconTheme.inc
@@ -18,6 +18,8 @@
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 */
 
+class ThemeFileParsingException extends Exception;
+
 class IconThemeDir
 {
   private $Size;
@@ -83,7 +85,7 @@ class IconTheme
     $this->path = $folder;
     $datas  = @parse_ini_file($folder.'/index.theme', TRUE, INI_SCANNER_RAW);
     if ($datas === FALSE) {
-      throw new Exception('Error while parsing theme file');
+      throw new ThemeFileParsingException('Error while parsing theme file');
     }
     if (isset($datas['Icon Theme']['Directories']) && !empty($datas['Icon Theme']['Directories'])) {
       $dirs   = preg_split('/,/', $datas['Icon Theme']['Directories']);
@@ -186,7 +188,8 @@ class IconTheme
             } else {
               $themes[$file] = new IconTheme("$path/$file", static::$default_theme);
             }
-          } catch (Exception $e) {
+          } catch (ThemeFileParsingException $e) {
+            continue;
           }
         }
       }
-- 
GitLab