From dbd92f2d58188029f7f7d19320305a8fadcb1d9f Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Nov 2022 11:19:03 +0800 Subject: [PATCH] [fix] load icons bug --- app/app.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index 66b86c4e..9fa96705 100644 --- a/app/app.go +++ b/app/app.go @@ -43,16 +43,15 @@ func LoadInfo(root string) { exception.New("解析应用失败 %s", 500, err).Throw() } } - - if fs.MustExists("/yao/icons/icon.icns") { + if has, _ := fs.Exists("/yao/icons/icon.icns"); has { info.Icons.Set("icns", xfs.Encode(fs.MustReadFile("/yao/icons/icon.icns"))) } - if fs.MustExists("/yao/icons/icon.ico") { + if has, _ := fs.Exists("/yao/icons/icon.ico"); has { info.Icons.Set("ico", xfs.Encode(fs.MustReadFile("/yao/icons/icon.ico"))) } - if fs.MustExists("/yao/icons/icon.png") { + if has, _ := fs.Exists("/yao/icons/icon.png"); has { info.Icons.Set("png", xfs.Encode(fs.MustReadFile("/yao/icons/icon.png"))) }