Skip to content

Commit

Permalink
show set library dialoge if Uri.decode(libraryUri.getEncodedPath()) r…
Browse files Browse the repository at this point in the history
…eturns null instead of crashing the app
  • Loading branch information
cgogolin committed Apr 3, 2018
1 parent 505af8c commit 0e2b1eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/com/cgogolin/library/Library.java
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,12 @@ protected void onPreExecute()
protected Void doInBackground(String... libraryPathString) {
if (bibtexAdapter == null)
{
Uri libraryUri = Uri.parse(libraryPathString[0]);
File libraryFile = new File(Uri.decode(libraryUri.getEncodedPath()));
InputStream inputStream = null;
try
{
Uri libraryUri = Uri.parse(libraryPathString[0]);
File libraryFile = new File(Uri.decode(libraryUri.getEncodedPath()));

if(libraryFile != null && libraryFile.isFile())
{
inputStream = new FileInputStream(libraryFile);
Expand Down

0 comments on commit 0e2b1eb

Please sign in to comment.