summaryrefslogtreecommitdiff
path: root/modules/exif/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-01 18:03:07 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-01 18:03:07 -0700
commitc31434ea3c3f819950f32337dfe80f83099c5b28 (patch)
treef9272b7625ee82e40ce3a8db6dfeff883528d961 /modules/exif/helpers
parentc94c11eb3e4f48d2dbcc73ea6ca9358170733392 (diff)
Don't bomb if there are no exif_records for the given item.
Diffstat (limited to 'modules/exif/helpers')
-rw-r--r--modules/exif/helpers/exif_theme.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/exif/helpers/exif_theme.php b/modules/exif/helpers/exif_theme.php
index 14186d15..bb6926d3 100644
--- a/modules/exif/helpers/exif_theme.php
+++ b/modules/exif/helpers/exif_theme.php
@@ -21,13 +21,13 @@ class exif_theme_Core {
static function sidebar_bottom($theme) {
$item = $theme->item();
if ($item && $item->is_photo()) {
- if (Database::instance()
- ->select("key_count")
- ->from("exif_records")
- ->where("item_id", $item->id)
- ->get()
- ->current()
- ->key_count) {
+ $record = Database::instance()
+ ->select("key_count")
+ ->from("exif_records")
+ ->where("item_id", $item->id)
+ ->get()
+ ->current();
+ if ($record && $record->key_count) {
$view = new View("exif_sidebar.html");
$view->item = $item;
return $view;