src: only access stack of non-null errors

Avoid segmentation fault when `null` is thrown
Merge remote-tracking branch 'upstream/master'