From 98ca08badd6ff53158c963e33c1dd89bfb2fa607 Mon Sep 17 00:00:00 2001 From: Joshua Bahnsen Date: Sun, 8 Dec 2013 00:41:30 -0700 Subject: [PATCH] Fix crash when viewing folder with videos --- AndroidManifest.xml | 4 +-- .../ultrasonic/androidapp/view/SongView.java | 26 ++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index dcd9328a..71834e1b 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + a:versionCode="39" + a:versionName="1.2.0.12" > diff --git a/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java b/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java index 874ff8d3..5d3ddaa1 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java @@ -302,7 +302,11 @@ public class SongView extends UpdateView implements Checkable if (downloadFile.isDownloading() && !downloadFile.isDownloadCancelled() && partialFile.exists()) { - this.statusTextView.setText(Util.formatLocalizedBytes(partialFile.length(), this.context)); + if (this.statusTextView != null) + { + this.statusTextView.setText(Util.formatLocalizedBytes(partialFile.length(), this.context)); + } + this.rightImageType = ImageType.downloading; this.rightImage = downloadingImage; } @@ -326,21 +330,31 @@ public class SongView extends UpdateView implements Checkable { this.previousLeftImageType = leftImageType; this.previousRightImageType = rightImageType; - this.statusTextView.setCompoundDrawablesWithIntrinsicBounds(leftImage, null, rightImage, null); + + if (this.statusTextView != null) + { + this.statusTextView.setCompoundDrawablesWithIntrinsicBounds(leftImage, null, rightImage, null); + } } if (!song.getStarred()) { - if (starImageView.getDrawable() != starHollowDrawable) + if (starImageView != null) { - starImageView.setImageDrawable(starHollowDrawable); + if (starImageView.getDrawable() != starHollowDrawable) + { + starImageView.setImageDrawable(starHollowDrawable); + } } } else { - if (starImageView.getDrawable() != starDrawable) + if (starImageView != null) { - starImageView.setImageDrawable(starDrawable); + if (starImageView.getDrawable() != starDrawable) + { + starImageView.setImageDrawable(starDrawable); + } } }