mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
Add nil check in send
This commit is contained in:
@@ -65,6 +65,9 @@ func (k *kitty_font_backend_type) start() (err error) {
|
|||||||
var kitty_font_backend kitty_font_backend_type
|
var kitty_font_backend kitty_font_backend_type
|
||||||
|
|
||||||
func (k *kitty_font_backend_type) send(v any) error {
|
func (k *kitty_font_backend_type) send(v any) error {
|
||||||
|
if k.to == nil {
|
||||||
|
return fmt.Errorf("Trying to send data when to pipe is nil")
|
||||||
|
}
|
||||||
data, err := json.Marshal(v)
|
data, err := json.Marshal(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Could not encode message to kitty with error: %w", err)
|
return fmt.Errorf("Could not encode message to kitty with error: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user