Alexander Nicolaysen Sørnes : screenshot : Fix random screenshot function

Chris Morgan cmorgan at winehq.org
Tue Oct 23 18:31:16 CDT 2007


Module: appdb
Branch: master
Commit: 58ef8e62e55b740e8d97ca164289f2f6cd0096da
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=58ef8e62e55b740e8d97ca164289f2f6cd0096da

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Tue Oct 23 13:55:18 2007 +0200

screenshot: Fix random screenshot function

---

 include/screenshot.php |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/screenshot.php b/include/screenshot.php
index 611b83b..81eec26 100644
--- a/include/screenshot.php
+++ b/include/screenshot.php
@@ -464,6 +464,7 @@ class screenshot
                                        $bFormatting = true) 
     {
         // initialize variables to avoid notices when appending to them
+        $hResult = null;
         $sImgFile = '';
         $sImg = '';
         // we want a random screenshots for this app
@@ -508,7 +509,7 @@ class screenshot
         $sZoomIcon = Screenshot::get_zoomicon_overlay();
 
         /* we have screenshots */
-        if(query_num_rows($hResult))
+        if($hResult && query_num_rows($hResult))
         {
             if($iVersionId)
                 $sImg .= "<a href='screenshots.php?iAppId=$iAppId&amp;iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>View/Submit&nbsp;Screenshot</center></a>";




More information about the wine-cvs mailing list