GUACAMOLE-422: Replace non-short-circuit logic in null check (&) with proper short-circuit logic (&&).
Checking `timezone != null & !timezone.isEmpty()` will result in a `NullPointerException` when `timezone` is null, as the `&` ensures `timezone.isEmpty()` will run in all cases.
This commit is contained in:
1 parent
f2ae848b1b
commit
092657aa79
1 file changed
+2
-2
@@ -167,9 +167,9 @@ public class TunnelRequestService {
|
|||||||
if (imageMimetypes != null)
|
if (imageMimetypes != null)
|
||||||
info.getImageMimetypes().addAll(imageMimetypes);
|
info.getImageMimetypes().addAll(imageMimetypes);
|
||||||
|
|
||||||
// Get the timezone value
|
// Set timezone if provided
|
||||||
String timezone = request.getTimezone();
|
String timezone = request.getTimezone();
|
||||||
if (timezone != null & !timezone.isEmpty())
|
if (timezone != null && !timezone.isEmpty())
|
||||||
info.setTimezone(timezone);
|
info.setTimezone(timezone);
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|||||||
Reference in new issue
Block a user