filetree icon indicating copy to clipboard operation
filetree copied to clipboard

FileTree loading fails if README.md is missing

Open peteruhnak opened this issue 7 years ago • 3 comments

https://github.com/dalehenrich/filetree/blob/pharo6.0_dev/repository/MonticelloFileTree-Core.package/MCFileTreeStCypressReader.class/instance/addClassAndMethodDefinitionsFromEntry..st#L8

When README.md is missing in the folder, then classComment will stay uninitialized and then will fail when specifying comment

self addClassDefinitionFrom: classPropertiesDict comment: classComment withSqueakLineEndings.

maybe a fix would be to just add to the beginning of the method classComment := '', or changing the retrieval to soemthing like

classComment := entries
	detect: [ :entry | entry name = 'README.md' ]
	ifFound: [ :commentEntry | commentEntry contents ]
	ifNone: [ '' ].

peteruhnak avatar Apr 24 '17 15:04 peteruhnak

... the README.md is required ... the creator of the filetree directory structure is supposed to create it correctly ...

dalehenrich avatar Apr 24 '17 16:04 dalehenrich

well one can run into this issue very easily when e.g. a bad code subdirectory is specified in baseline. And considering the error message is withSqueakLineEndings was sent to nil it is not the most obvious thing to fix. I've ran into this maybe five times this year and every time I see it I am confused for a bit.

So alternative to fixing the code could be providing meaningful error message.

peteruhnak avatar Apr 24 '17 18:04 peteruhnak

yeah meaningful error message is the ticket ... THX!

dalehenrich avatar Apr 24 '17 19:04 dalehenrich