Skip to content
Snippets Groups Projects
Commit 4fbba376 authored by joelpittet's avatar joelpittet Committed by Chris Leppanen
Browse files

Issue #1887632 by joelpittet: Exception: Empty configuration identifier.

parent b860e725
No related branches found
No related tags found
No related merge requests found
...@@ -380,9 +380,10 @@ function feeds_importer_load($id) { ...@@ -380,9 +380,10 @@ function feeds_importer_load($id) {
try { try {
return feeds_importer($id)->existing(); return feeds_importer($id)->existing();
} }
catch (FeedsNotExistingException $e) { catch (FeedsNotExistingException $e) {}
return FALSE; catch (InvalidArgumentException $e) {}
}
return FALSE;
} }
/** /**
......
...@@ -44,15 +44,16 @@ abstract class FeedsConfigurable { ...@@ -44,15 +44,16 @@ abstract class FeedsConfigurable {
protected $disabled; protected $disabled;
/** /**
* Instantiate a FeedsConfigurable object. * Instantiates a FeedsConfigurable object.
* *
* Don't use directly, use feeds_importer() or feeds_plugin() * Don't use directly, use feeds_importer() or feeds_plugin() instead.
* instead. *
* @see feeds_importer()
* @see feeds_plugin()
*/ */
public static function instance($class, $id) { public static function instance($class, $id) {
// This is useful at least as long as we're developing. if (!strlen($id)) {
if (empty($id)) { throw new InvalidArgumentException(t('Empty configuration identifier.'));
throw new Exception(t('Empty configuration identifier.'));
} }
static $instances = array(); static $instances = array();
if (!isset($instances[$class][$id])) { if (!isset($instances[$class][$id])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment