Catch exception from file_size. v2.13.57
authorCarl Hetherington <cth@carlh.net>
Fri, 28 Sep 2018 00:22:25 +0000 (01:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 28 Sep 2018 00:22:25 +0000 (01:22 +0100)
src/tools/dcpomatic_player.cc

index 3eec00e51402725dbcf2074f7261bc69474b1bbb..1742f654051cfedb76d4d296458657be45519d77 100644 (file)
@@ -334,15 +334,15 @@ public:
                        return optional<dcp::EncryptedKDM>();
                }
                for (directory_iterator i = directory_iterator(*kdm_dir); i != directory_iterator(); ++i) {
-                       if (file_size(i->path()) < MAX_KDM_SIZE) {
-                               try {
+                       try {
+                               if (file_size(i->path()) < MAX_KDM_SIZE) {
                                        dcp::EncryptedKDM kdm (dcp::file_to_string(i->path()));
                                        if (kdm.cpl_id() == dcp->cpl()) {
                                                return kdm;
                                        }
-                               } catch (std::exception& e) {
-                                       /* Hey well */
                                }
+                       } catch (std::exception& e) {
+                               /* Hey well */
                        }
                }
                return optional<dcp::EncryptedKDM>();