--- a/printer/plainprinter.go Sat May 27 18:39:13 2017 +0200
+++ b/printer/plainprinter.go Sat May 27 18:41:32 2017 +0200
@@ -294,12 +294,12 @@
//return p.PrintObj(s.MediaAttachments, w, indent+p.Indent)
for _, a := range s.MediaAttachments {
indentedPrint(w, indent+p.Indent, true, false, "Attachment ID", "%d", a.ID)
- if a.TextURL != "" {
- indentedPrint(w, indent+p.Indent, true, false, "Text URL", "%s", a.TextURL)
+ if a.TextURL != nil && *a.TextURL != "" {
+ indentedPrint(w, indent+p.Indent, true, false, "Text URL", "%s", *a.TextURL)
} else if a.URL != "" {
indentedPrint(w, indent+p.Indent, false, false, "URL", "%s", a.URL)
- } else {
- indentedPrint(w, indent+p.Indent, false, false, "Remote URL", "%s", a.RemoteURL)
+ } else if a.RemoteURL != nil {
+ indentedPrint(w, indent+p.Indent, false, false, "Remote URL", "%s", *a.RemoteURL)
}
}
return nil