Permalink
Browse files

IsInvalid test was too aggressive

  • Loading branch information...
tobi committed Sep 5, 2012
1 parent ba702be commit 2fe68b4cc017383f40256b61525824c86a9779af
Showing with 4 additions and 4 deletions.
  1. +4 −4 gd.go
  2. 0 image.gif
View
8 gd.go
@@ -12,9 +12,9 @@ import (
)
var (
- imageError = errors.New("[GD] image is nil")
- createError = errors.New("[GD] cannot create new image")
- writeError = errors.New("[GD] image cannot be written")
+ imageError = errors.New("[GD] image is nil")
+ createError = errors.New("[GD] cannot create new image")
+ writeError = errors.New("[GD] image cannot be written")
)
type gdImage struct {
@@ -79,7 +79,7 @@ func (p *gdImage) gdDestroy() {
}
func isInvalid(p *gdImage) bool {
- return p == nil || p.img.pixels != nil
+ return p == nil || p.img == nil
}
func (p *gdImage) width() int {
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2fe68b4

Please sign in to comment.