summaryrefslogtreecommitdiff
path: root/deviantion.go
diff options
context:
space:
mode:
Diffstat (limited to 'deviantion.go')
-rw-r--r--deviantion.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/deviantion.go b/deviantion.go
index 288b0e2..197f2af 100644
--- a/deviantion.go
+++ b/deviantion.go
@@ -149,12 +149,15 @@ func GetDeviation(id string, user string) (st Post, err Error) {
}
}
- json.Unmarshal([]byte(txt), &description)
- for _, a := range description.Blocks {
- txt = a.Text
- }
- }
+ if err := json.Unmarshal([]byte(txt), &description); err != nil {
+ // Handle error appropriately
+ try(err) // or log/return the error
+ }
+ for _, a := range description.Blocks {
+ txt = a.Text
+ }
+ }
st.Description = txt
-
+
return
}