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

Medialibrary: add init checks

parent cf9ac030
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ public class Medialibrary {
}
public String[] getDevices() {
return nativeDevices();
return mIsInitiated ? nativeDevices() : new String[0];
}
public void addDevice(String uuid, String path, boolean removable) {
......@@ -86,11 +86,13 @@ public class Medialibrary {
}
public void discover(String path) {
nativeDiscover(Tools.encodeVLCMrl(path));
if (mIsInitiated)
nativeDiscover(Tools.encodeVLCMrl(path));
}
public void removeFolder(String path) {
nativeRemoveEntryPoint(Tools.encodeVLCMrl(path));
if (mIsInitiated)
nativeRemoveEntryPoint(Tools.encodeVLCMrl(path));
}
public String[] getFoldersList() {
......@@ -100,7 +102,7 @@ public class Medialibrary {
}
public boolean removeDevice(String uuid) {
return nativeRemoveDevice(uuid);
return mIsInitiated && nativeRemoveDevice(uuid);
}
@Override
......
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