mirror of
https://github.com/penpot/penpot.git
synced 2025-04-10 05:51:33 -05:00
🐛 Prevent exception on broken path.
This commit is contained in:
parent
438c14d29d
commit
9e06275945
4 changed files with 28 additions and 10 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
figwheel_server.log
|
||||
*jar
|
||||
*.penpot
|
||||
*.jar
|
||||
*-init.clj
|
||||
.lein-deps-sum
|
||||
.lein-failures
|
||||
|
@ -9,9 +10,10 @@ figwheel_server.log
|
|||
.nrepl-port
|
||||
.cpcache
|
||||
.rebel_readline_history
|
||||
node_modules
|
||||
/clj-profiler/
|
||||
/vendor/**/target
|
||||
/cd.md
|
||||
node_modules
|
||||
/backend/target/
|
||||
/backend/resources/public/media
|
||||
/backend/resources/public/assets
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
"A main namespace for server repl."
|
||||
#_:clj-kondo/ignore
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.pages :as cp]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.common.pages.migrations :as pmg]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.db.sql :as sql]
|
||||
|
@ -12,12 +13,12 @@
|
|||
[app.rpc.queries.profile :as prof]
|
||||
[app.srepl.dev :as dev]
|
||||
[app.util.blob :as blob]
|
||||
[cuerdas.core :as str]
|
||||
[clojure.pprint :refer [pprint]]))
|
||||
[clojure.pprint :refer [pprint]]
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
(defn update-file
|
||||
([id f] (update-file id f false))
|
||||
([id f save?]
|
||||
([system id f] (update-file system id f false))
|
||||
([system id f save?]
|
||||
(db/with-atomic [conn (:app.db/pool system)]
|
||||
(let [file (db/get-by-id conn :file id {:for-update true})
|
||||
file (-> file
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
(ns app.main.ui.shapes.path
|
||||
(:require
|
||||
[app.common.logging :as log]
|
||||
[app.main.ui.shapes.attrs :as attrs]
|
||||
[app.main.ui.shapes.custom-stroke :refer [shape-custom-stroke]]
|
||||
[app.util.object :as obj]
|
||||
|
@ -19,10 +20,21 @@
|
|||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
content (:content shape)
|
||||
pdata (mf/use-memo (mf/deps content) #(upf/format-path content))
|
||||
pdata (mf/use-memo
|
||||
(mf/deps content)
|
||||
(fn []
|
||||
(try
|
||||
(upf/format-path content)
|
||||
(catch :default e
|
||||
(log/error :hint "unexpected error on formating path"
|
||||
:shape-name (:name shape)
|
||||
:shape-id (:id shape)
|
||||
:cause e)
|
||||
""))))
|
||||
|
||||
props (-> (attrs/extract-style-attrs shape)
|
||||
(obj/merge!
|
||||
#js {:d pdata}))]
|
||||
|
||||
[:& shape-custom-stroke {:shape shape}
|
||||
[:> :path props]]))
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
(ns app.main.ui.workspace.viewport.outline
|
||||
(:require
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.geom.shapes :as gsh]
|
||||
[app.common.pages :as cp]
|
||||
[app.main.refs :as refs]
|
||||
|
@ -27,7 +28,9 @@
|
|||
path-data
|
||||
(mf/use-memo
|
||||
(mf/deps shape)
|
||||
#(when path? (upf/format-path (:content shape))))
|
||||
#(when path?
|
||||
(or (ex/ignoring (upf/format-path (:content shape)))
|
||||
"")))
|
||||
|
||||
{:keys [x y width height selrect]} shape
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue