@@ -75,6 +75,7 @@ INLINE ConfigVariable::
7575// //////////////////////////////////////////////////////////////////
7676INLINE const ConfigDeclaration *ConfigVariable::
7777get_default_value () const {
78+ nassertr (_core != (ConfigVariableCore *)NULL , NULL );
7879 return _core->get_default_value ();
7980}
8081
@@ -86,6 +87,7 @@ get_default_value() const {
8687// //////////////////////////////////////////////////////////////////
8788INLINE const string &ConfigVariable::
8889get_string_value () const {
90+ nassertr (_core != (ConfigVariableCore *)NULL , *new string ());
8991 const ConfigDeclaration *decl = _core->get_declaration (0 );
9092 return decl->get_string_value ();
9193}
@@ -100,6 +102,7 @@ get_string_value() const {
100102// //////////////////////////////////////////////////////////////////
101103INLINE void ConfigVariable::
102104set_string_value (const string &string_value) {
105+ nassertv (_core != (ConfigVariableCore *)NULL );
103106 _core->make_local_value ()->set_string_value (string_value);
104107}
105108
@@ -112,6 +115,7 @@ set_string_value(const string &string_value) {
112115// //////////////////////////////////////////////////////////////////
113116INLINE int ConfigVariable::
114117get_num_words () const {
118+ nassertr (_core != (ConfigVariableCore *)NULL , 0 );
115119 const ConfigDeclaration *decl = _core->get_declaration (0 );
116120 return decl->get_num_words ();
117121}
@@ -126,6 +130,7 @@ get_num_words() const {
126130// //////////////////////////////////////////////////////////////////
127131INLINE bool ConfigVariable::
128132has_string_word (int n) const {
133+ nassertr (_core != (ConfigVariableCore *)NULL , false );
129134 const ConfigDeclaration *decl = _core->get_declaration (0 );
130135 return decl->has_string_word (n);
131136}
@@ -138,6 +143,7 @@ has_string_word(int n) const {
138143// //////////////////////////////////////////////////////////////////
139144INLINE bool ConfigVariable::
140145has_bool_word (int n) const {
146+ nassertr (_core != (ConfigVariableCore *)NULL , false );
141147 const ConfigDeclaration *decl = _core->get_declaration (0 );
142148 return decl->has_bool_word (n);
143149}
@@ -150,6 +156,7 @@ has_bool_word(int n) const {
150156// //////////////////////////////////////////////////////////////////
151157INLINE bool ConfigVariable::
152158has_int_word (int n) const {
159+ nassertr (_core != (ConfigVariableCore *)NULL , false );
153160 const ConfigDeclaration *decl = _core->get_declaration (0 );
154161 return decl->has_int_word (n);
155162}
@@ -162,6 +169,7 @@ has_int_word(int n) const {
162169// //////////////////////////////////////////////////////////////////
163170INLINE bool ConfigVariable::
164171has_double_word (int n) const {
172+ nassertr (_core != (ConfigVariableCore *)NULL , false );
165173 const ConfigDeclaration *decl = _core->get_declaration (0 );
166174 return decl->has_double_word (n);
167175}
@@ -175,6 +183,7 @@ has_double_word(int n) const {
175183// //////////////////////////////////////////////////////////////////
176184INLINE string ConfigVariable::
177185get_string_word (int n) const {
186+ nassertr (_core != (ConfigVariableCore *)NULL , string ());
178187 const ConfigDeclaration *decl = _core->get_declaration (0 );
179188 return decl->get_string_word (n);
180189}
@@ -188,6 +197,7 @@ get_string_word(int n) const {
188197// //////////////////////////////////////////////////////////////////
189198INLINE bool ConfigVariable::
190199get_bool_word (int n) const {
200+ nassertr (_core != (ConfigVariableCore *)NULL , false );
191201 const ConfigDeclaration *decl = _core->get_declaration (0 );
192202 return decl->get_bool_word (n);
193203}
@@ -201,6 +211,7 @@ get_bool_word(int n) const {
201211// //////////////////////////////////////////////////////////////////
202212INLINE int ConfigVariable::
203213get_int_word (int n) const {
214+ nassertr (_core != (ConfigVariableCore *)NULL , 0 );
204215 const ConfigDeclaration *decl = _core->get_declaration (0 );
205216 return decl->get_int_word (n);
206217}
@@ -214,6 +225,7 @@ get_int_word(int n) const {
214225// //////////////////////////////////////////////////////////////////
215226INLINE double ConfigVariable::
216227get_double_word (int n) const {
228+ nassertr (_core != (ConfigVariableCore *)NULL , 0.0 );
217229 const ConfigDeclaration *decl = _core->get_declaration (0 );
218230 return decl->get_double_word (n);
219231}
@@ -226,6 +238,7 @@ get_double_word(int n) const {
226238// //////////////////////////////////////////////////////////////////
227239INLINE void ConfigVariable::
228240set_string_word (int n, const string &value) {
241+ nassertv (_core != (ConfigVariableCore *)NULL );
229242 _core->make_local_value ()->set_string_word (n, value);
230243}
231244
@@ -237,6 +250,7 @@ set_string_word(int n, const string &value) {
237250// //////////////////////////////////////////////////////////////////
238251INLINE void ConfigVariable::
239252set_bool_word (int n, bool value) {
253+ nassertv (_core != (ConfigVariableCore *)NULL );
240254 _core->make_local_value ()->set_bool_word (n, value);
241255}
242256
@@ -248,6 +262,7 @@ set_bool_word(int n, bool value) {
248262// //////////////////////////////////////////////////////////////////
249263INLINE void ConfigVariable::
250264set_int_word (int n, int value) {
265+ nassertv (_core != (ConfigVariableCore *)NULL );
251266 _core->make_local_value ()->set_int_word (n, value);
252267}
253268
@@ -259,5 +274,6 @@ set_int_word(int n, int value) {
259274// //////////////////////////////////////////////////////////////////
260275INLINE void ConfigVariable::
261276set_double_word (int n, double value) {
277+ nassertv (_core != (ConfigVariableCore *)NULL );
262278 _core->make_local_value ()->set_double_word (n, value);
263279}
0 commit comments