<commit_before>package com.gbaldera.yts.activities;

import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;

import com.gbaldera.yts.R;
import com.gbaldera.yts.fragments.SearchMoviesFragment;

public class SearchActivity extends BaseDrawerActivity {

    private static String TAG = "SearchMoviesFragment";

    private SearchMoviesFragment mSearchFragment;
    private SearchView mSearchView = null;
    private String mQuery = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search);

        if(getIntent().getAction().equals(Intent.ACTION_SEARCH)){
            String query = getIntent().getStringExtra(SearchManager.QUERY);
            query = query == null ? "" : query;
            mQuery = query;
        }

        mSearchFragment = ( SearchMoviesFragment) getFragmentManager().findFragmentByTag(TAG);

        if (mSearchFragment == null) {
            mSearchFragment = new SearchMoviesFragment();
            getFragmentManager().beginTransaction()
                    .add(R.id.container, mSearchFragment, TAG)
                    .commit();
        }
<commit_msg>Fixed null exception trying to access the getAction() from intent<commit_after>package com.gbaldera.yts.activities;

import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;

import com.gbaldera.yts.R;
import com.gbaldera.yts.fragments.SearchMoviesFragment;

public class SearchActivity extends BaseDrawerActivity {

    private static String TAG = "SearchMoviesFragment";

    private SearchMoviesFragment mSearchFragment;
    private SearchView mSearchView = null;
    private String mQuery = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search);

        if(getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_SEARCH)){
            String query = getIntent().getStringExtra(SearchManager.QUERY);
            query = query == null ? "" : query;
            mQuery = query;
        }

        mSearchFragment = ( SearchMoviesFragment) getFragmentManager().findFragmentByTag(TAG);

        if (mSearchFragment == null) {
            mSearchFragment = new SearchMoviesFragment();
            getFragmentManager().beginTransaction()
                    .add(R.id.container, mSearchFragment, TAG)
                    .commit();
        }

{'fraction_non_alphanumeric': 0.09668212629325723, 'fraction_numerical': 0.0007135212272565109, 'mean_word_length': 3.280916030534351, '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': '6345772', 'n_tokens_mistral': 767, 'n_tokens_neox': 730, 'n_words': 153}