Browse Source

default on string value if json decode fails

tags/0.1.11
Robin Thoni 8 years ago
parent
commit
853b9d9d86
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/Utils/LuRoute.php

+ 3
- 0
src/Utils/LuRoute.php View File

70
             try
70
             try
71
             {
71
             {
72
                 $json = json_decode($value, true);
72
                 $json = json_decode($value, true);
73
+                if (is_null($json)) {
74
+                    $json = $value . "";
75
+                }
73
                 $typedValue = call_user_func_array(array($class->getName(), "jsonDeserialize"), array($json));
76
                 $typedValue = call_user_func_array(array($class->getName(), "jsonDeserialize"), array($json));
74
             }
77
             }
75
             catch (LuDboDeserializeException $e)
78
             catch (LuDboDeserializeException $e)

Loading…
Cancel
Save