<commit_before>﻿namespace RedBlueGames.ToolsExamples
{
    using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;

    public class PrimitiveCreatorSaveData : ScriptableObject
    {
        public List<PrimitiveCreator.Config> ConfigPresets;

        public bool HasConfigForIndex(int index)
        {
            if (this.ConfigPresets == null || this.ConfigPresets.Count == 0)
            {
                return false;
            }
            
            return index >= 0 && index < this.ConfigPresets.Count;
        }<commit_msg>Fix NPE where saveData was accessed before being initialized<commit_after>﻿namespace RedBlueGames.ToolsExamples
{
    using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;

    public class PrimitiveCreatorSaveData : ScriptableObject
    {
        public List<PrimitiveCreator.Config> ConfigPresets;

        private void OnEnable()
        {
            if (this.ConfigPresets == null)
            {
                this.ConfigPresets = new List<PrimitiveCreator.Config>();
            }
        }

        public bool HasConfigForIndex(int index)
        {
            if (this.ConfigPresets == null || this.ConfigPresets.Count == 0)
            {
                return false;
            }
            
            return index >= 0 && index < this.ConfigPresets.Count;
        }
{'fraction_non_alphanumeric': 0.0772005772005772, 'fraction_numerical': 0.002886002886002886, 'mean_word_length': 1.9385593220338984, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '3869185', 'n_tokens_mistral': 357, 'n_tokens_neox': 346, 'n_words': 79}