Fixed NullPointerException

This commit is contained in:
dkeen@dkeen-laptop 2012-04-24 16:13:23 -07:00
parent ec71764aad
commit 742837f654
2 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dougkeen.bart"
android:versionCode="14"
android:versionName="1.2.1" >
android:versionCode="15"
android:versionName="1.2.2" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

View File

@ -326,7 +326,7 @@ public class Departure implements Parcelable, Comparable<Departure> {
}
private int getEqualsTolerance() {
if (origin.longStationLinger && hasDeparted()) {
if (origin != null && origin.longStationLinger && hasDeparted()) {
return ESTIMATE_EQUALS_TOLERANCE_LONG_LINGER_MILLIS;
} else {
return ESTIMATE_EQUALS_TOLERANCE_MILLIS;
@ -337,7 +337,7 @@ public class Departure implements Parcelable, Comparable<Departure> {
StringBuilder builder = new StringBuilder();
int secondsLeft = getMeanSecondsLeft();
if (hasDeparted()) {
if (origin.longStationLinger && beganAsDeparted) {
if (origin != null && origin.longStationLinger && beganAsDeparted) {
builder.append("At station");
} else {
builder.append("Departed");