Author: fejj
Date: 2008-02-20 15:25:53 -0500 (Wed, 20 Feb 2008)
New Revision: 96312

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin-class.cpp
Log:
2008-02-20  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        * plugin-class.cpp (MoonlightTextBlockObject::Invoke): The
        downloader argument is allowed to be null.



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2008-02-20 20:12:22 UTC (rev 96311)
+++ trunk/moon/plugin/ChangeLog 2008-02-20 20:25:53 UTC (rev 96312)
@@ -1,3 +1,8 @@
+2008-02-20  Jeffrey Stedfast  <[EMAIL PROTECTED]>
+
+       * plugin-class.cpp (MoonlightTextBlockObject::Invoke): The
+       downloader argument is allowed to be null.
+
 2008-02-20  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
        * plugin.cpp, plugin.h, plugin-debug.cpp, plugin-debug.h: Add a 
'Sources'

Modified: trunk/moon/plugin/plugin-class.cpp
===================================================================
--- trunk/moon/plugin/plugin-class.cpp  2008-02-20 20:12:22 UTC (rev 96311)
+++ trunk/moon/plugin/plugin-class.cpp  2008-02-20 20:25:53 UTC (rev 96312)
@@ -2971,8 +2971,7 @@
 }
 
 
-static const MoonNameIdMapping
-moonlight_text_block_mapping [] = {
+static const MoonNameIdMapping moonlight_text_block_mapping[] = {
        { "setfontsource", MoonId_SetFontSource }
 };
 
@@ -2983,24 +2982,23 @@
                                  NPVariant *result)
 {
        TextBlock *tb = (TextBlock *) GetDependencyObject ();
-
+       DependencyObject *downloader = NULL;
+       
        switch (id) {
-       case MoonId_SetFontSource: {
-               if (argCount != 1 || !NPVARIANT_IS_OBJECT (args[0]))
+       case MoonId_SetFontSource:
+               if (argCount != 1 || !(NPVARIANT_IS_OBJECT (args[0]) || 
NPVARIANT_IS_NULL(args[0])))
                        THROW_JS_EXCEPTION ("setFontSource");
-
-               DependencyObject *downloader = 
((MoonlightDependencyObjectObject *) 
NPVARIANT_TO_OBJECT(args[0]))->GetDependencyObject ();
-
+               
+               if (NPVARIANT_IS_OBJECT (args[0]))
+                       downloader = ((MoonlightDependencyObjectObject *) 
NPVARIANT_TO_OBJECT(args[0]))->GetDependencyObject ();
+               
                tb->SetFontSource (downloader);
-
+               
                VOID_TO_NPVARIANT (*result);
-
+               
                return true;
-       }
        default:
-               return MoonlightDependencyObjectObject::Invoke (id, name,
-                                                               args, argCount,
-                                                               result);
+               return MoonlightDependencyObjectObject::Invoke (id, name, args, 
argCount, result);
        }
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to