Browse Source

notice fixes

Lukas Kahwe Smith 14 years ago
parent
commit
900dda8239
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/Symfony/Component/Serializer/Serializer.php

+ 6 - 2
src/Symfony/Component/Serializer/Serializer.php

@@ -196,7 +196,9 @@ class Serializer implements SerializerInterface
      */
      */
     public function getEncoder($format)
     public function getEncoder($format)
     {
     {
-        return $this->encoders[$format];
+        if (isset($this->encoders[$format])) {
+            return $this->encoders[$format];
+        }
     }
     }
 
 
     /**
     /**
@@ -220,6 +222,8 @@ class Serializer implements SerializerInterface
      */
      */
     public function removeEncoder($format)
     public function removeEncoder($format)
     {
     {
-        unset($this->encoders[$format]);
+        if (isset($this->encoders[$format])) {
+            unset($this->encoders[$format]);
+        }
     }
     }
 }
 }