minor fixes for user errors

This commit is contained in:
kepler155c@gmail.com 2019-11-02 12:23:40 -06:00
parent 5c35a8383e
commit fba2d48a4b
2 changed files with 4 additions and 1 deletions

View File

@ -19,6 +19,9 @@ function linkfs.mount(_, source)
error('Source is required')
end
source = fs.combine(source, '')
if not fs.exists(source) then
error('Source is missing')
end
if fs.isDir(source) then
return {
source = source,

View File

@ -152,7 +152,7 @@ function Canvas:write(x, y, text, bg, fg)
bg = _rep(self.palette[bg], #text)
end
if fg then
fg = _rep(self.palette[fg], #text)
fg = _rep(self.palette[fg] or self.palette[1], #text)
end
self:blit(x, y, text, bg, fg)
end