handle Camera.list() returning null

This commit is contained in:
codeanticode
2013-10-24 10:19:57 -04:00
parent 59371bd884
commit 91e416b28e

View File

@@ -13,11 +13,13 @@ void setup() {
String[] cameras = Capture.list();
if (cameras.length == 0) {
if (cameras == null) {
println("Failed to retrieve the list of available cameras, will try the default...");
cam = new Capture(this, 640, 480);
} if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
}
else {
} else {
println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);