mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Handling situation when resolutions array is null.
This commit is contained in:
@@ -473,11 +473,18 @@ public class Capture extends PImage implements PConstants {
|
||||
* @return Resolution[]
|
||||
*/
|
||||
public Resolution[] resolutions() {
|
||||
int n = resolutions.size();
|
||||
Resolution[] res = new Resolution[n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
res[i] = new Resolution((Resolution)resolutions.get(i));
|
||||
Resolution[] res;
|
||||
|
||||
if (resolutions == null) {
|
||||
res = new Resolution[0];
|
||||
} else {
|
||||
int n = resolutions.size();
|
||||
res = new Resolution[n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
res[i] = new Resolution((Resolution)resolutions.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user