mirror of
https://github.com/processing/processing4.git
synced 2026-01-28 10:51:07 +01:00
handle Camera.list() returning null
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user