]> git.saurik.com Git - cydget.git/commitdiff
Render exceptions that are thrown by PhotoExample.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 14 Dec 2014 12:45:42 +0000 (04:45 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 14 Dec 2014 12:47:26 +0000 (04:47 -0800)
PhotoExample.cydget/index.html

index 1fc5c243957c6ae822ad044286b52ae19f6147f4..55269172d111daa4019ecf428ff89b7b3a0aaf66 100644 (file)
     </script>
     <div id="content">
         <script type="text/cycript" src="lcd.cy"></script>
-    <script type="text/cycript">
+    <script type="text/cycript"> try {
         dlopen("/System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary", RTLD_GLOBAL);
 
         var version = typeof PLCameraAlbum != "undefined" && [PLCameraAlbum respondsToSelector:@selector(sharedInstance)] ? 0 : 1;
             if (jpeg != null)
                 document.write('<img src="' + jpeg.toString() + '"/>');
         }
-    </script></div>
+    } catch (e) {
+        document.write(e.toString());
+    } </script></div>
 </body></html>