Skip to content
Permalink
Browse files
(android) improve defensive code for NULL check
  • Loading branch information
NiklasMerz committed Jan 2, 2020
1 parent 0411a28 commit d4338bd64ac599dfec4aeec6d02c3ccccd3ecaec
Showing 1 changed file with 7 additions and 9 deletions.
@@ -313,7 +313,7 @@ else if (action.equals("show")) {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if(dialog != null){
if (dialog != null) {
dialog.show();
}
}
@@ -326,7 +326,7 @@ else if (action.equals("hide")) {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if(dialog != null){
if (dialog != null) {
dialog.hide();
}
}
@@ -1069,17 +1069,15 @@ public void postMessage(String data) {
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.MATCH_PARENT;

dialog.setContentView(main);
if(dialog != null){
if (dialog != null) {
dialog.setContentView(main);
dialog.show();
dialog.getWindow().setAttributes(lp);
}
dialog.getWindow().setAttributes(lp);
// the goal of openhidden is to load the url and not display it
// Show() needs to be called to cause the URL to be loaded
if(openWindowHidden) {
if(dialog != null){
dialog.hide();
}
if (openWindowHidden && dialog != null) {
dialog.hide();
}
}
};

0 comments on commit d4338bd

Please sign in to comment.