sendgrid / go-gmime Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
We should return an error, instead of panic'ing.
Since this is a library, we should let the caller deal with the error.
For example, when calling parse.Recipients()
on a message with an empty To list:
(process:24446): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
panic: ZERO pointer
goroutine 25 [running]:
panic(0x42edfa0, 0xc8201b8d10)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/sendgrid/go-gmime/gmime.ref(0x0)
/Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/gmime.go:48 +0x75
github.com/sendgrid/go-gmime/gmime.AssignJanitor(0x5e00158, 0xc8201b46a8)
/Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/janitor.go:22 +0x39
github.com/sendgrid/go-gmime/gmime.CastPointer(0x0, 0x41c719f)
/Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/janitor.go:34 +0x81
github.com/sendgrid/go-gmime/gmime.CastInternetAddressList(0x0, 0x44bc748)
/Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/internet_address.go:189 +0x21
github.com/sendgrid/go-gmime/gmime.(*aMessage).AllRecipients(0xc8201b45e8, 0x0)
/Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/message.go:152 +0xc2
github.com/sendgrid/go-gmime/gmime.(*aParse).Recipients(0xc8201b8cd0, 0x0, 0x0)
/Users/trevorrothaus/go/src/github.com/sendgrid/go-gmime/gmime/parse.go:64 +0x45
When Canonical form of the key is different from the actual key, headers().Values() would not return the right value, since the internal map doesn't have the canonical form as the key. Users can get the values by treating Mimeheader as a map as a workaround- but this is confusing and can cause unexpected consequences.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.