fixed crash for no author
This commit is contained in:
@@ -3,3 +3,5 @@
|
|||||||
* Fixed missing whitespace in share_text string
|
* Fixed missing whitespace in share_text string
|
||||||
* Changed about fragment appearance
|
* Changed about fragment appearance
|
||||||
* Fixed NPE when rotating device in BookDetail fragment by retaining it
|
* Fixed NPE when rotating device in BookDetail fragment by retaining it
|
||||||
|
|
||||||
|
* Fixed crash if a book has no author
|
||||||
@@ -169,7 +169,10 @@ public class AddBook extends Fragment implements LoaderManager.LoaderCallbacks<C
|
|||||||
((TextView) rootView.findViewById(R.id.bookSubTitle)).setText(bookSubTitle);
|
((TextView) rootView.findViewById(R.id.bookSubTitle)).setText(bookSubTitle);
|
||||||
|
|
||||||
String authors = data.getString(data.getColumnIndex(AlexandriaContract.AuthorEntry.AUTHOR));
|
String authors = data.getString(data.getColumnIndex(AlexandriaContract.AuthorEntry.AUTHOR));
|
||||||
String[] authorsArr = authors.split(",");
|
if(authors == null)
|
||||||
|
authors = "";
|
||||||
|
String[] authorsArr;
|
||||||
|
authorsArr = authors.split(",");
|
||||||
((TextView) rootView.findViewById(R.id.authors)).setLines(authorsArr.length);
|
((TextView) rootView.findViewById(R.id.authors)).setLines(authorsArr.length);
|
||||||
((TextView) rootView.findViewById(R.id.authors)).setText(authors.replace(",","\n"));
|
((TextView) rootView.findViewById(R.id.authors)).setText(authors.replace(",","\n"));
|
||||||
String imgUrl = data.getString(data.getColumnIndex(AlexandriaContract.BookEntry.IMAGE_URL));
|
String imgUrl = data.getString(data.getColumnIndex(AlexandriaContract.BookEntry.IMAGE_URL));
|
||||||
|
|||||||
Reference in New Issue
Block a user