Skip to content
Snippets Groups Projects
Commit 1d0b9879 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Ensure we don't call addDevice with empty args

parent 9651be2c
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.widget.Toolbar;
import android.support.v7.widget.ViewStubCompat;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
......@@ -415,7 +416,8 @@ public class AudioPlayerContainerActivity extends BaseActivity implements Playba
uuid = ((Uri) msg.obj).getLastPathSegment();
String path = ((Uri) msg.obj).getPath();
removeMessages(ACTION_MEDIA_UNMOUNTED);
if (!PreferenceManager.getDefaultSharedPreferences(owner).getBoolean("ignore_"+ uuid, false)) {
if (!TextUtils.isEmpty(uuid)
&& !PreferenceManager.getDefaultSharedPreferences(owner).getBoolean("ignore_"+ uuid, false)) {
if (VLCApplication.getMLInstance().addDevice(uuid, path, true, true)) {
owner.startActivity(new Intent(owner, DialogActivity.class)
.setAction(DialogActivity.KEY_STORAGE)
......
......@@ -35,6 +35,7 @@ import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
import android.view.KeyEvent;
import org.videolan.medialibrary.Medialibrary;
......@@ -140,6 +141,8 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
} else if (action.equalsIgnoreCase(Intent.ACTION_MEDIA_MOUNTED)) {
String path = intent.getData().getPath();
String uuid = intent.getData().getLastPathSegment();
if (TextUtils.isEmpty(uuid))
return;
boolean isIgnored = mSettings.getBoolean("ignore_"+ uuid, false);
if (!isIgnored && mMediaLibrary.addDevice(uuid, path, true, true)) {
startActivity(new Intent(BaseTvActivity.this, DialogActivity.class)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment