From 42f552b5eeb209ba32282c87f61414bcaf85cf23 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 19 Nov 2013 00:22:56 +0100 Subject: small bug fixes --- src/de/blinkt/openvpn/VpnProfile.java | 2 +- src/de/blinkt/openvpn/fragments/LogFragment.java | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/de/blinkt') diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index 7b5faae3..79c94779 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -647,7 +647,7 @@ public class VpnProfile implements Serializable { } catch (AssertionError e) { if (tries ==0) return null; - Toast.makeText(context, String.format("Failure getting Keystore Keys (%s), retrying",e.getLocalizedMessage()),Toast.LENGTH_LONG).show(); + VpnStatus.logError(String.format("Failure getting Keystore Keys (%s), retrying",e.getLocalizedMessage())); try { Thread.sleep(3000); } catch (InterruptedException e1) { diff --git a/src/de/blinkt/openvpn/fragments/LogFragment.java b/src/de/blinkt/openvpn/fragments/LogFragment.java index 750b5703..721f0707 100644 --- a/src/de/blinkt/openvpn/fragments/LogFragment.java +++ b/src/de/blinkt/openvpn/fragments/LogFragment.java @@ -103,14 +103,16 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. final String down = String.format("%2$s/s %1$s", humanReadableByteCount(in, false), humanReadableByteCount(diffIn / OpenVPNManagement.mBytecountInterval, true)); final String up = String.format("%2$s/s %1$s", humanReadableByteCount(out, false), humanReadableByteCount(diffOut / OpenVPNManagement.mBytecountInterval, true)); - if(mUpStatus!=null && mDownStatus!=null) { - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - mUpStatus.setText(up); - mDownStatus.setText(down); - } - }); + if (mUpStatus != null && mDownStatus != null) { + if (getActivity() != null) { + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + mUpStatus.setText(up); + mDownStatus.setText(down); + } + }); + } } } -- cgit v1.2.3