From 1871c27390290fef4f805e26085adc9495b2f1a6 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 3 Sep 2016 13:28:25 +0200 Subject: return false if compressed video size = 0 or video does't exist --- .../de/pixart/messenger/services/XmppConnectionService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 75231f037..962c43dcc 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -590,9 +590,15 @@ public class XmppConnectionService extends Service { protected void onPostExecute(Boolean compressed) { super.onPostExecute(compressed); wakeLock.release(); + File video = new File(compressedpath); if (mListener != null) { - mListener.videocompressed(compressed); - Log.d(Config.LOGTAG, "Compression successfully!"); + if (video.exists() && video.length() > 0) { + mListener.videocompressed(compressed); + Log.d(Config.LOGTAG, "Compression successfully!"); + } else { + mListener.videocompressed(false); + Log.d(Config.LOGTAG, "Compression failed!"); + } } } } -- cgit v1.2.3