diff --git a/CHANGES.md b/CHANGES.md index 2e433a77..29565cd6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,9 +1,12 @@ # Rojo Change Log ## Current Master +* Fixed using a service as the target of a partition (part of #11) + * There are still cases that will trigger errors, like putting an `init.lua` file inside of a service. + * **Note that the contents of the service will be synced with the filesystem, so any existing items will be deleted!** * Fixed server when using a file as a partition * Previously, trailing slashes were put on the end of a partition even if the read request was an empty string. This broke file reading on Windows when a partition pointed to a file instead of a directory! -* Started running automatic tests on Travis CI +* Started running automatic tests on Travis CI (#9) * This is only for the server right now * Soon, I'll upgrade [Lemur](http://github.com/LPGhatguy/Lemur) to have APIs necessary for testing plugins and start testing the plugion portion of Rojo as well. diff --git a/plugin/src/Reconciler.lua b/plugin/src/Reconciler.lua index 38176aa9..062f0dee 100644 --- a/plugin/src/Reconciler.lua +++ b/plugin/src/Reconciler.lua @@ -171,8 +171,13 @@ function Reconciler.reconcile(rbx, item, fileName, parent) end else if rbx.ClassName ~= "Folder" then - rbx:Destroy() - return Reconciler._reify(item, fileName, parent) + -- Certain objects (services) can't be destroyed. + -- If we target one of these, leave it alone! + local ok = pcall(rbx.Destroy, rbx) + + if ok then + return Reconciler._reify(item, fileName, parent) + end end end