<commit_before>package fr.neamar.kiss.normalizer;

import android.os.Build;
import android.telephony.PhoneNumberUtils;

import java.util.Locale;

public class PhoneNormalizer {
    public static String normalizePhone(String phoneNumber) {
        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            return PhoneNumberUtils.formatNumber(phoneNumber, Locale.getDefault().getCountry());
        } else {
            return PhoneNumberUtils.formatNumber(phoneNumber);
        }
    }
}<commit_msg>NullPointException on empty phone (fix #281)<commit_after>package fr.neamar.kiss.normalizer;

import android.os.Build;
import android.telephony.PhoneNumberUtils;

import java.util.Locale;

public class PhoneNormalizer {
    public static String normalizePhone(String phoneNumber) {
        if(phoneNumber == null) {
            return "";
        }
        
        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            return PhoneNumberUtils.formatNumber(phoneNumber, Locale.getDefault().getCountry());
        } else {
            return PhoneNumberUtils.formatNumber(phoneNumber);
        }
    }
}
{'fraction_non_alphanumeric': 0.09853068280034573, 'fraction_numerical': 0.0025929127052722557, 'mean_word_length': 3.2573529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2768577', 'n_tokens_mistral': 328, 'n_tokens_neox': 323, 'n_words': 58}