Skip to content

armgit / haven

Public Imported from GitHub
0

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors

Add URIs for valid file / file paths only

Arka Prava Basu85c60a583c48
diff --git a/src/main/java/org/havenapp/main/ui/EventActivity.java b/src/main/java/org/havenapp/main/ui/EventActivity.java
index 309201f..b55f714 100644
--- a/src/main/java/org/havenapp/main/ui/EventActivity.java
+++ b/src/main/java/org/havenapp/main/ui/EventActivity.java
@@ -156,6 +156,10 @@ public class EventActivity extends AppCompatActivity {
//convert from paths to Android friendly Parcelable Uri's
for (EventTrigger trigger : mEvent.getEventTriggers())
{
+ // ignore triggers for which we do not have valid file/file-paths
+ if (trigger.getMimeType() == null || trigger.getPath() == null)
+ continue;
+
File fileIn = new File(trigger.getPath());
Uri u = Uri.fromFile(fileIn);
uris.add(u);