inkdropapp / inkdrop-alfred-workflow

A simple Alfred workflow for Inkdrop
MIT License
8 stars 2 forks source link

handling no body on title:body arg #6

Closed picklecillo closed 6 days ago

picklecillo commented 1 week ago

Hey @craftzdog!

Noticed creating a new note with no body like ink+ title gets a warning that shows up as a notification.

image

From the debugger:

Warning: Undefined array key 1 in /Users/picklecillo/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/524CB052-5DDF-40AA-A4E5-BED3DBE86F3E on line 16

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/picklecillo/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.3950022E-4F14-43AE-8C35-A64FE61E433D/inkdrop.php on line 62

to fix it, i'm using array_pad so that the expected second argument defaults to an empty string '' instead of null.

craftzdog commented 6 days ago

shipped 🙌 https://github.com/inkdropapp/inkdrop-alfred-workflow/releases/tag/v0.2.1