2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-08-31 14:25:56 +00:00

Move empty string test for crop option parsing

For consistency with other options.
This commit is contained in:
Romain Vimont
2023-10-26 22:42:46 +02:00
parent 76a99a7fcd
commit b7ad652a75

View File

@@ -256,7 +256,9 @@ public class Options {
options.tunnelForward = Boolean.parseBoolean(value); options.tunnelForward = Boolean.parseBoolean(value);
break; break;
case "crop": case "crop":
if (!value.isEmpty()) {
options.crop = parseCrop(value); options.crop = parseCrop(value);
}
break; break;
case "control": case "control":
options.control = Boolean.parseBoolean(value); options.control = Boolean.parseBoolean(value);
@@ -337,9 +339,6 @@ public class Options {
} }
private static Rect parseCrop(String crop) { private static Rect parseCrop(String crop) {
if (crop.isEmpty()) {
return null;
}
// input format: "width:height:x:y" // input format: "width:height:x:y"
String[] tokens = crop.split(":"); String[] tokens = crop.split(":");
if (tokens.length != 4) { if (tokens.length != 4) {