Skip to content

Commit

Permalink
fix: remove throw
Browse files Browse the repository at this point in the history
  • Loading branch information
kadiraydinli committed Nov 18, 2023
1 parent 0695427 commit 78514a4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ public void setFitsSystemWindows(
try {
int requiredVersion = Build.VERSION_CODES.LOLLIPOP;
if (Build.VERSION.SDK_INT < requiredVersion) {
throw new IllegalViewOperationException(errorMessage(requiredVersion));
promise.reject("Error: ", errorMessage(requiredVersion));
}
final Activity currentActivity = getCurrentActivity();
if (currentActivity == null) {
throw new IllegalViewOperationException("current activity is null");
promise.reject("Error: ", "current activity is null");
}
final Window view = currentActivity.getWindow();
runOnUiThread(
Expand Down Expand Up @@ -466,9 +466,6 @@ private void setSystemUIFlags(int visibility, Promise promise) {
}

private void setModeStyle(Boolean light, Integer bar) {
if (getCurrentActivity() == null) {
throw new IllegalViewOperationException("current activity is null");
}
int visibility = 0;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Expand Down Expand Up @@ -518,6 +515,9 @@ private void setModeStyle(Boolean light, Integer bar, Promise promise) {
try {
runOnUiThread(
() -> {
if (getCurrentActivity() == null) {
promise.reject("Error: ", "current activity is null");
}
setModeStyle(light, bar);
promise.resolve("true");
}
Expand Down

0 comments on commit 78514a4

Please sign in to comment.