Skip to content

Commit

Permalink
Fix a bug that caused crashes when filePathRoot didn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
inmysocks committed Oct 31, 2022
1 parent b9376a0 commit f16d2f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changelog.tid
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ title: $:/plugins/OokTech/Bob/Changelog
* Fix language handling so Bob can actually use different translations
* Turn off the save throttling in Bob because the core now has improved handling for the task queue so we don't have to work around it anymore.
** This could still be sped up significantly if we update chooseNextTask in Syncer.js so that it can handle dispatching multiple tasks at once. At the moment it looks like the problem is handling retrying after an error.
* Start the process of adding multi-save ability to the syncadaptor
* Fix a bug that caused the server to crash when the filePathRoot didn't exist

!! Version 1.7.2 Puppies and Kittens

Expand Down
3 changes: 2 additions & 1 deletion ControlPanel/FileServerSetup.tid
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ nothing.
!! Media in the FilePathRoot <<helpButton $:/plugins/OokTech/Bob/AboutListMediaInFilePathRoot>>

<$button>
Fetch list of media in the filePathRoot folder
Fetch list of media in the <$text text=filePathRoot/> folder
<$action-websocketmessage
type='listFiles'
folder='/files'
Expand Down Expand Up @@ -222,6 +222,7 @@ nothing.
>
<$list
filter='[enlist{$:/state/fileList/files!!list}]'
emptyMessage="//No Files to Show//"
>
<$button>
<<currentTiddler>>
Expand Down
2 changes: 1 addition & 1 deletion ServerSide.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ ServerSide.listFiles = function(data, cb) {
fs.readdir(resolvedPath, function(err, items) {
if(err || !items) {
$tw.Bob.logger.error("Can't read files folder ", resolvedPath, " with error ", err, {level: 1});
cb(prefix, [], urlPath);
cb(prefix, [], urlPath, wikiName);
} else {
// filter the list to only include listed mimetypes.
let filteredItems = items.filter(function(item) {
Expand Down

0 comments on commit f16d2f4

Please sign in to comment.