Fix reported null pointer error in the Java code

This commit is contained in:
Henrik Rydgård committed 2017-06-04 11:51:24 +02:00
1 parent 0f5c59dc28
commit 2391c0edd5
1 file changed
+9 -3
@@ -2,6 +2,7 @@ package org.ppsspp.ppsspp;
import android.app.AlertDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
@@ -76,9 +77,14 @@ public class PpssppActivity extends NativeActivity {
Intent intent = getIntent();
String action = intent.getAction();
if (Intent.ACTION_VIEW.equals(action)) {
String path = intent.getData().getPath();
super.setShortcutParam(path);
Toast.makeText(getApplicationContext(), path, Toast.LENGTH_SHORT).show();
Uri data = intent.getData();
if (data != null) {
String path = intent.getData().getPath();
super.setShortcutParam(path);
Toast.makeText(getApplicationContext(), path, Toast.LENGTH_SHORT).show();
} else {
Log.e(TAG, "Got ACTION_VIEW without a valid uri");
}
} else {
super.setShortcutParam(getIntent().getStringExtra(SHORTCUT_EXTRA_KEY));
}