Add null check in preload
authorj-h.choi <j-h.choi@samsung.com>
Wed, 13 Jan 2021 08:38:06 +0000 (17:38 +0900)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Wed, 20 Jan 2021 01:43:01 +0000 (10:43 +0900)
Change-Id: I51fa05c104c40d3a539ed07ff87912857ea3d4f8

Managed/Tizen.Runtime/Preloader.cs

index 814d15c..8dd07b4 100644 (file)
@@ -100,11 +100,19 @@ namespace Tizen.Runtime
                             Assembly asm = AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(assemblyStr));
                             Type type = asm.GetType(typenameStr);
                             if (type == null)
+                            {
                                 Console.WriteLine("[Warning] Check the '" + line + "' in " + fileName);
+                                continue;
+                            }
 
                             if (methodStr != "")
                             {
                                 MethodInfo method = type.GetMethod(methodStr, bindingFlag);
+                                if (method == null)
+                                {
+                                    Console.WriteLine("[Warning] Check the '" + line + "' in " + fileName);
+                                    continue;
+                                }
                                 method.Invoke(null, null);
                             }
                         }