diff --git a/iNaturalist/src/main/AndroidManifest.xml b/iNaturalist/src/main/AndroidManifest.xml index f3ba53002..3e7a1c8fb 100644 --- a/iNaturalist/src/main/AndroidManifest.xml +++ b/iNaturalist/src/main/AndroidManifest.xml @@ -3,8 +3,8 @@ xmlns:tools="http://schemas.android.com/tools" package="org.inaturalist.android" android:installLocation="auto" - android:versionCode="596" - android:versionName="1.30.3"> + android:versionCode="597" + android:versionName="1.30.4"> diff --git a/iNaturalist/src/main/java/org/inaturalist/android/ObservationViewerFragment.java b/iNaturalist/src/main/java/org/inaturalist/android/ObservationViewerFragment.java index 7500da4d5..e9409f764 100644 --- a/iNaturalist/src/main/java/org/inaturalist/android/ObservationViewerFragment.java +++ b/iNaturalist/src/main/java/org/inaturalist/android/ObservationViewerFragment.java @@ -462,7 +462,8 @@ public Object instantiateItem(ViewGroup container, final int position) { if (mObsJson != null) { try { - BetterJSONObject obsSound = new BetterJSONObject(new JSONObject(mObsJson).getJSONArray("observation_sounds").getJSONObject(position - mObservation.photos.size())); + int obsPhotoCount = mObservation.photos != null ? mObservation.photos.size() : 0; + BetterJSONObject obsSound = new BetterJSONObject(new JSONObject(mObsJson).getJSONArray("observation_sounds").getJSONObject(position - obsPhotoCount)); item = new BetterJSONObject(obsSound.getJSONObject("sound")); isHidden = new ObservationSound(obsSound).hidden; } catch (JSONException e) {