Skip to content

Commit dcdf006

Browse files
authored
Merge pull request #79 from takahiro0327/search-problems
Fix search problems in ObjectBrowser
2 parents 9d3d712 + 4768375 commit dcdf006

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

RuntimeUnityEditor/Utils/Extensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public static class Extensions
1818
{
1919
public static bool Contains(this string s, string searchText, StringComparison sc)
2020
{
21+
if (string.IsNullOrEmpty(s) || string.IsNullOrEmpty(searchText))
22+
return false;
2123
return s.IndexOf(searchText, sc) >= 0;
2224
}
2325

RuntimeUnityEditor/Windows/ObjectTree/RootGameObjectSearcher.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,11 @@ private IEnumerator IndexObjectsCo()
436436

437437
if (timer.ElapsedMilliseconds > 20)
438438
{
439-
timer.Reset();
440439
_indexingTimer.Stop();
441440

442441
yield return null;
443442

444443
_indexingTimer.Start();
445-
timer.Start();
446444

447445
_searchResults = DoSearch();
448446

@@ -451,6 +449,9 @@ private IEnumerator IndexObjectsCo()
451449
RuntimeUnityEditorCore.Logger.Log(LogLevel.Debug, "Restarting indexing...");
452450
goto Restart;
453451
}
452+
453+
timer.Reset();
454+
timer.Start();
454455
}
455456
}
456457

0 commit comments

Comments
 (0)