Kaydet (Commit) 8fe5b478 authored tarafından Artur Dryomov's avatar Artur Dryomov

Add checks before return server name.

Try to avoid possible NPE.

Change-Id: I7e89ac38251b0840c66e36f9e0284be2073424c3
üst 6f509451
...@@ -10,6 +10,7 @@ package org.libreoffice.impressremote.communication; ...@@ -10,6 +10,7 @@ package org.libreoffice.impressremote.communication;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.text.TextUtils;
public class Server implements Parcelable { public class Server implements Parcelable {
private static final int SPECIAL_PARCELABLE_OBJECTS_BITMASK = 0; private static final int SPECIAL_PARCELABLE_OBJECTS_BITMASK = 0;
...@@ -45,6 +46,14 @@ public class Server implements Parcelable { ...@@ -45,6 +46,14 @@ public class Server implements Parcelable {
} }
public String getName() { public String getName() {
if (mName == null) {
return mAddress;
}
if (TextUtils.isEmpty(mName)) {
return mAddress;
}
return mName; return mName;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment