Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/src/main/java/me/bzcoder/webview/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

private void loadUrl(String mUrl, String mTitle) {
X5WebViewActivity.loadUrl(this, mUrl, mTitle);
if(mUrl = null){
return;
}else{
mUrl = null;
X5WebViewActivity.loadUrl(this, mUrl, mTitle);
}
Comment on lines +145 to +150

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The null check is using = (assignment) instead of == (equality). Also, setting mUrl = null in the else block will always result in a null URL being loaded. The intention was likely to prevent loading a null URL, but the current implementation defeats that purpose. Consider removing the else block entirely, or modifying it to handle the case where mUrl is not null appropriately. If the intention is to prevent loading a null URL, then the else block is unnecessary.

        if(mUrl == null){
            return;
        }
        X5WebViewActivity.loadUrl(this, mUrl, mTitle);


}


Expand Down
Loading