Skip to content

Commit 1d27fff

Browse files
emmanuel-ferdmanKernelDeimos
authored andcommitted
Fix issue in invalid social media url
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent 2c4da6f commit 1d27fff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/src/services/PuterHomepageService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@ class PuterHomepageService extends BaseService {
217217
const bundled = env != 'dev' || use_bundled_gui;
218218

219219
// check if social media image is a valid absolute URL
220-
let is_social_media_image_valid = true;
221-
if (social_media_image && !is_valid_url(social_media_image)) {
220+
let is_social_media_image_valid = !!social_media_image;
221+
if (is_social_media_image_valid && !is_valid_url(social_media_image)) {
222222
is_social_media_image_valid = false;
223223
}
224224

225225
// check if social media image ends with a valid image extension
226-
if (social_media_image && !/\.(png|jpg|jpeg|gif|webp)$/.test(social_media_image.toLowerCase())) {
226+
if (is_social_media_image_valid && !/\.(png|jpg|jpeg|gif|webp)$/.test(social_media_image.toLowerCase())) {
227227
is_social_media_image_valid = false;
228228
}
229229

0 commit comments

Comments
 (0)