vision: fix panic when calling detect on URI with no text
@@ -521,8 +521,12 @@ func detectDocumentTextURI(w io.Writer, file string) error {
return err
}
+ if annotation == nil {
+ fmt.Fprintln(w, "No text found.")
+ } else {
fmt.Fprintln(w, "Text:")
fmt.Fprintf(w, "%q\n", annotation.Text)
+ }
return nil
}
