Skip to content

Commit b984c17

Browse files
committed
make sure the file is text before making replacements
1 parent fad16a6 commit b984c17

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Assets/FbxExporters/Editor/FbxExporterRepairMissingScripts.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ private static bool ReplaceGUIDInFile (string path)
7575

7676
try {
7777
var sr = new StreamReader (path);
78+
79+
// verify that this is a text file
80+
if(sr.Peek() > -1){
81+
var firstLine = sr.ReadLine();
82+
if(!firstLine.StartsWith("%YAML")){
83+
sr.Close ();
84+
return false;
85+
}
86+
}
87+
7888
var sw = new StreamWriter (path + ".remap", false);
7989

8090
while (sr.Peek () > -1) {

0 commit comments

Comments
 (0)