projects
/
horde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d1c8d7
)
Don't assume the gallery will always have images.
author
Michael J. Rubinsky
<mrubinsk@horde.org>
Mon, 30 Aug 2010 20:16:40 +0000
(16:16 -0400)
committer
Michael J. Rubinsky
<mrubinsk@horde.org>
Mon, 30 Aug 2010 20:16:40 +0000
(16:16 -0400)
Bug: 9200
ansel/lib/ImageGenerator.php
patch
|
blob
|
history
diff --git
a/ansel/lib/ImageGenerator.php
b/ansel/lib/ImageGenerator.php
index
15a9ff1
..
a4e9457
100644
(file)
--- a/
ansel/lib/ImageGenerator.php
+++ b/
ansel/lib/ImageGenerator.php
@@
-179,9
+179,11
@@
class Ansel_ImageGenerator
$rnd = mt_rand(0, $cnt);
try {
$temp = $gallery->getImages($rnd, 1);
- $aimg = array_shift($temp);
- $aimg->load('screen');
- $images[] = $aimg->getHordeImage();
+ if (count($temp)) {
+ $aimg = array_shift($temp);
+ $aimg->load('screen');
+ $images[] = $aimg->getHordeImage();
+ }
} catch (Exception $e) {
Horde::logMessage($e, 'ERR');
}