<commit_before>package com.singhajit.rubygems.core;

import android.content.Context;
import android.support.design.widget.Snackbar;
import android.view.View;

import com.singhajit.rubygems.R;

public class ErrorHandler {
  public static void showSnackBar(View rootView, String message, View.OnClickListener listener) {
    Context context = rootView.getContext();
    String msg = message == null || message.isEmpty() ? context.getString(R.string.generic_error_msg) : message;
    Snackbar.make(rootView, msg, Snackbar.LENGTH_LONG).setAction(context.getString(R.string.retry), listener).show();
  }
}
<commit_msg>hanling null pointer exception while showing snackbar<commit_after>package com.singhajit.rubygems.core;

import android.content.Context;
import android.support.design.widget.Snackbar;
import android.view.View;

import com.singhajit.rubygems.R;

public class ErrorHandler {
  public static void showSnackBar(View rootView, String message, View.OnClickListener listener) {
    if (rootView != null) {
      Context context = rootView.getContext();
      String msg = message == null || message.isEmpty() ? context.getString(R.string.generic_error_msg) : message;
      Snackbar.make(rootView, msg, Snackbar.LENGTH_LONG).setAction(context.getString(R.string.retry), listener).show();
    }
  }
}

{'fraction_non_alphanumeric': 0.11332312404287902, 'fraction_numerical': 0.0, 'mean_word_length': 5.194312796208531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6742809', 'n_tokens_mistral': 393, 'n_tokens_neox': 393, 'n_words': 81}