Skip to content

Commit 2f3b6fb

Browse files
committed
Fix NullException
1 parent 9d3d712 commit 2f3b6fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
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

0 commit comments

Comments
 (0)