package io.github.droidkaigi.confsched2017.view.helper;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.webkit.URLUtil;

import timber.log.Timber;

public class IntentHelper {

    /**
     * Builds an intent of type Intent.ACTION_VIEW from the passed htmlUrl.
     * But, When intent.resolveActivity(context.getPackageManager()) == null is true, it return null.
     */
    public static Intent buildActionViewIntent(@NonNull Context context, @NonNull String htmlUrl) {
        Timber.i("buildActionViewIntent: url: %s", htmlUrl);

        if (!URLUtil.isNetworkUrl(htmlUrl)) {
            return null;
        }

        Uri uri = Uri.parse(htmlUrl);
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);

        if (intent.resolveActivity(context.getPackageManager()) == null) {
            return null;
        }

        return intent;
    }
}

@@ -180,16 +180,47 @@
 onNull;%0A
+import android.text.TextUtils;%0A
 import a
@@ -589,24 +589,162 @@
  htmlUrl) %7B%0A
+        if (TextUtils.isEmpty(htmlUrl)) %7B%0A            Timber.i(%22buildActionViewIntent: url is null%22);%0A            return null;%0A        %7D%0A%0A
         Timb

Add url null check