[NUI] Fix SVACE issue, 5th trial (#269)
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 25 May 2018 08:03:02 +0000 (17:03 +0900)
committerGitHub <noreply@github.com>
Fri, 25 May 2018 08:03:02 +0000 (17:03 +0900)
src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticResourceExtension.cs

index 8bad461..5041c2c 100755 (executable)
@@ -42,10 +42,12 @@ namespace Tizen.NUI.Xaml
                        var pi = valueProvider.TargetProperty as PropertyInfo;
                        var propertyType = bp?.ReturnType ?? pi?.PropertyType;
                        if (propertyType == null) {
-                               if (resource.GetType().GetTypeInfo().IsGenericType && (resource.GetType().GetGenericTypeDefinition() == typeof(OnPlatform<>) || resource.GetType().GetGenericTypeDefinition() == typeof(OnIdiom<>))) {
-                                       // This is only there to support our backward compat story with pre 2.3.3 compiled Xaml project who was not providing TargetProperty
-                                       var method = resource.GetType().GetRuntimeMethod("op_Implicit", new[] { resource.GetType() });
-                                       resource = method.Invoke(null, new[] { resource });
+                               if (resource != null) { 
+                                       if (resource.GetType().GetTypeInfo().IsGenericType && (resource.GetType().GetGenericTypeDefinition() == typeof(OnPlatform<>) || resource.GetType().GetGenericTypeDefinition() == typeof(OnIdiom<>))) {
+                                               // This is only there to support our backward compat story with pre 2.3.3 compiled Xaml project who was not providing TargetProperty
+                                               var method = resource.GetType().GetRuntimeMethod("op_Implicit", new[] { resource.GetType() });
+                                               resource = method.Invoke(null, new[] { resource });
+                                       }
                                }
                                return resource;
                        }
@@ -89,4 +91,4 @@ namespace Tizen.NUI.Xaml
                        return resource;
                }
        }
-}
\ No newline at end of file
+}