diff --git a/include/osgDB/Serializer b/include/osgDB/Serializer
index bb896149e..9e6e9f5ae 100644
--- a/include/osgDB/Serializer
+++ b/include/osgDB/Serializer
@@ -244,14 +244,14 @@ public:
if ( is.isBinary() )
{
is >> value;
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
else if ( is.matchString(ParentType::_name) )
{
if ( _useHex ) is >> std::hex;
is >> value;
if ( _useHex ) is >> std::dec;
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
return true;
}
@@ -302,12 +302,12 @@ public:
if ( is.isBinary() )
{
is >> value;
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
else if ( is.matchString(ParentType::_name) )
{
is >> value;
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
return true;
}
@@ -350,12 +350,12 @@ public:
if ( is.isBinary() )
{
readMatrixImplementation( is, value );
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
else if ( is.matchString(ParentType::_name) )
{
readMatrixImplementation( is, value );
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
return true;
}
@@ -417,12 +417,12 @@ public:
if ( is.isBinary() )
{
GLenum value; is >> value;
- (object.*_setter)( static_cast
(value) );
+ if (_setter!=0) (object.*_setter)( static_cast
(value) );
}
else if ( is.matchString(ParentType::_name) )
{
DEF_GLENUM(value); is >> value;
- (object.*_setter)( static_cast
(value.get()) );
+ if (_setter!=0) (object.*_setter)( static_cast
(value.get()) );
}
return true;
}
@@ -465,12 +465,12 @@ public:
if ( is.isBinary() )
{
is >> value;
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
else if ( is.matchString(ParentType::_name) )
{
is.readWrappedString( value );
- if ( !value.empty() )
+ if ( !value.empty() && (_setter!=0) )
(object.*_setter)( value );
}
return true;
@@ -522,7 +522,7 @@ public:
if ( hasObject )
{
P* value = dynamic_cast
( is.readObject() );
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
}
else if ( is.matchString(ParentType::_name) )
@@ -532,7 +532,7 @@ public:
{
is >> is.BEGIN_BRACKET;
P* value = dynamic_cast
( is.readObject() );
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
is >> is.END_BRACKET;
}
}
@@ -592,7 +592,7 @@ public:
if ( hasObject )
{
P* value = dynamic_cast
( is.readImage() );
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
}
}
else if ( is.matchString(ParentType::_name) )
@@ -602,7 +602,7 @@ public:
{
is >> is.BEGIN_BRACKET;
P* value = dynamic_cast
( is.readImage() );
- (object.*_setter)( value );
+ if (_setter!=0) (object.*_setter)( value );
is >> is.END_BRACKET;
}
}
@@ -667,12 +667,12 @@ public:
if ( is.isBinary() )
{
is >> value;
- (object.*_setter)( static_cast
(value) );
+ if (_setter!=0) (object.*_setter)( static_cast