Do not try to validate empty params.

redesign-copyrights
Frode Petterson 2015-06-16 14:52:22 +02:00
parent d8cf40623e
commit 2beff66195
1 changed files with 3 additions and 0 deletions

View File

@ -1766,6 +1766,9 @@ class H5PCore {
'library' => H5PCore::libraryToString($content['library']), 'library' => H5PCore::libraryToString($content['library']),
'params' => json_decode($content['params']) 'params' => json_decode($content['params'])
); );
if (!$params->params) {
return NULL;
}
$validator->validateLibrary($params, (object) array('options' => array($params->library))); $validator->validateLibrary($params, (object) array('options' => array($params->library)));
$params = json_encode($params->params); $params = json_encode($params->params);