diff --git a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java index d42926788..102541d64 100644 --- a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java +++ b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java @@ -120,10 +120,10 @@ public final class DeviceUtils { final Method getEnabledMethod = desktopModeStateClass .getDeclaredMethod("getEnabled"); final int enabled = (int) getEnabledMethod.invoke(desktopModeState); - final boolean isEnabled = enabled == desktopModeStateClass - .getDeclaredField("ENABLED").getInt(desktopModeStateClass); - - isDeXMode = isEnabled; + if (enabled == desktopModeStateClass + .getDeclaredField("ENABLED").getInt(desktopModeStateClass)) { + isDeXMode = true; + } } catch (NoSuchFieldException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { // Device does not support DeX 3.0