From 098720c46e351ab41295ad451b8d70e7f794ee4d Mon Sep 17 00:00:00 2001
From: Malf Furious <m@lfurio.us>
Date: Thu, 21 Mar 2019 23:50:40 -0400
Subject: Don't remove bg image if it fails to set

This behavior was causing issues in the UI.  We normally "try" to set a
new asset by default, in case one was provided by the user, and just
soft-fail if one wasn't.  This "soft-failing" is now resulting in the
images being removed if the user just goes in to change his alias (for
example).

Signed-off-by: Malf Furious <m@lfurio.us>
---
 app/class/obj.class.php | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

(limited to 'app/class')

diff --git a/app/class/obj.class.php b/app/class/obj.class.php
index 9d3ac9a..bd546b2 100644
--- a/app/class/obj.class.php
+++ b/app/class/obj.class.php
@@ -298,21 +298,17 @@ class obj extends table
         /* bgs image */
         $bgs = "dynmic/bgs/" . $this->guid;
         if (!saveIfFile($image, $bgs, self::BG_MAXSIZE, self::IMAGE_MIME))
-            goto fail;
+            return false;
 
         /* thumbs image */
         $thumbs = "dynmic/thumbs/" . $this->guid;
         if (!copy($bgs, $thumbs))
-            goto fail;
+            return false;
 
         if (!imageSquareCrop($thumbs))
-            goto fail;
+            return false;
 
         return true;
-
-fail:
-        $this->rmBgImg();
-        return false;
     }
 
     /*
-- 
cgit v1.2.3