mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-09-15 14:01:58 +00:00
Move empty string test for crop option parsing
For consistency with other options.
This commit is contained in:
parent
76a99a7fcd
commit
b7ad652a75
1 changed files with 3 additions and 4 deletions
|
@ -256,7 +256,9 @@ public class Options {
|
|||
options.tunnelForward = Boolean.parseBoolean(value);
|
||||
break;
|
||||
case "crop":
|
||||
options.crop = parseCrop(value);
|
||||
if (!value.isEmpty()) {
|
||||
options.crop = parseCrop(value);
|
||||
}
|
||||
break;
|
||||
case "control":
|
||||
options.control = Boolean.parseBoolean(value);
|
||||
|
@ -337,9 +339,6 @@ public class Options {
|
|||
}
|
||||
|
||||
private static Rect parseCrop(String crop) {
|
||||
if (crop.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// input format: "width:height:x:y"
|
||||
String[] tokens = crop.split(":");
|
||||
if (tokens.length != 4) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue