Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #28 from Connexions/book-url-fix
Browse files Browse the repository at this point in the history
Fixed user reported null pointer
  • Loading branch information
edwoodward authored Aug 4, 2017
2 parents a73a599 + 3438832 commit d11074a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.cnx.android"
minSdkVersion 19
targetSdkVersion 25
versionCode 39
versionName "6.4"
versionCode 40
versionName "6.5"
}
dependencies{
compile 'com.android.support:appcompat-v7:25.3.1'
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/cnx/android/handlers/MenuHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public boolean handleContextMenu(int item, Context context, Content currentConte
//Log.d("MenuHandler","title - " + currentContent.getTitle()) ;
cv.put(Favs.TITLE, currentContent.getTitle());
//Log.d("MnHndlr.handleCont...()","URL: " + currentContent.getUrl().toString());
String url = currentContent.getUrl().toString();
if(isSearch(url, context))
String url = currentContent.getUrl();
if(url == null || url.equals("") || isSearch(url, context))
{
return false;
}
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/org/cnx/android/logic/WebviewLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public class WebviewLogic
{
public String getBookURL(String url)
{
if(url == null)
{
return "";
}
int cIndex = url.lastIndexOf(":");
if(cIndex > 5)
{
Expand Down Expand Up @@ -87,8 +91,9 @@ public String getBookTitle(String title)
public void setContentURLs(String currentURL, Content content)
{
content.setUrl(currentURL);
WebviewLogic wl = new WebviewLogic();
String bookURL = wl.getBookURL(currentURL);
//WebviewLogic wl = new WebviewLogic();
//String bookURL = wl.getBookURL(currentURL);
String bookURL = getBookURL(currentURL);
content.setBookUrl(bookURL);
}
}

0 comments on commit d11074a

Please sign in to comment.