Closed randomPoison closed 9 years ago
Hm, missing scripts... I cannot think of any solution that would be smarter than just ignoring those components. So yes, a pull request woul be appreciated :smiley:
I made a pull request with the changes. That solves the problem of crashing when attempting to merge a scene with missing scripts, but I don't think it should be the final solution. Missing scripts are often caused by bad merges, such as renaming a script file without updating the associated components. It would be better to at least warn the user that this is happening rather than silently discarding the component.
I was trying out GitMerge and I ran into an error at GameObjectExtensions.cs line 17:
In this case,
original
wasnull
so the call toGetType()
was throwing an exception. I walked up the call stack to find the whereoriginal
was passed in, and found it was inGameObjectMergeActions.FindComponentDifferences()
:This winds up happening if a game object has a missing script. The best solution would be to better handle these cases of missing scripts, but for the time being it would be good to skip over any elements of
ourComponents
ortheirComponents
that are null.If you think this is a reasonable solution, I'll be happy to make a pull request for it.