aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-13 18:26:55 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-13 18:26:55 +0000
commit5884aa01d1264004ed16423833eac7928ef235fe (patch)
tree4aca94e3ff8eeb22e934760afaa239d91f2b4015
parenta2cfa6266483bf6d9cfc988d6adecaf8673c36ca (diff)
downloadelgg-5884aa01d1264004ed16423833eac7928ef235fe.tar.gz
elgg-5884aa01d1264004ed16423833eac7928ef235fe.tar.bz2
Catching error on datalists
git-svn-id: https://code.elgg.org/elgg/trunk@2252 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/elgglib.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index e7bdbe665..5d31354eb 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1478,10 +1478,14 @@
$name = sanitise_string($name);
if (isset($DATALIST_CACHE[$name]))
return $DATALIST_CACHE[$name];
-
- if ($row = get_data_row("select value from {$CONFIG->dbprefix}datalists where name = '{$name}'")) {
- $DATALIST_CACHE[$name] = $row->value;
- return $row->value;
+
+ try {
+ if ($row = get_data_row("select value from {$CONFIG->dbprefix}datalists where name = '{$name}'")) {
+ $DATALIST_CACHE[$name] = $row->value;
+ return $row->value;
+ }
+ } catch (DatabaseException $e) {
+ return false; // Likely can't handle the exception so just return false.
}
return false;