]> git.sesse.net Git - vlc/commitdiff
mozilla plugin: cosmetics.
authorJP Dinger <jpd@videolan.org>
Sat, 30 May 2009 20:34:46 +0000 (22:34 +0200)
committerJP Dinger <jpd@videolan.org>
Sat, 30 May 2009 20:34:46 +0000 (22:34 +0200)
projects/mozilla/control/npolibvlc.cpp

index 5f49b24d08a496e599f3f43c577d32c358ffa5e1..31e0e1e876a1b5aaea1f462eb6c58d6ed57456cd 100644 (file)
@@ -799,27 +799,20 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
             {
                 if( (argCount < 1) || (argCount > 3) )
                     return INVOKERESULT_NO_SUCH_METHOD;
-
-                char *url = NULL;
+                if( !NPVARIANT_IS_STRING(args[0]) )
+                    return INVOKERESULT_NO_SUCH_METHOD;
 
                 // grab URL
-                if( NPVARIANT_IS_STRING(args[0]) )
-                {
-                    char *s = stringValue(NPVARIANT_TO_STRING(args[0]));
-                    if( s )
-                    {
-                        url = p_plugin->getAbsoluteURL(s);
-                        if( url )
-                            free(s);
-                        else
-                            // problem with combining url, use argument
-                            url = s;
-                    }
-                    else
-                        return INVOKERESULT_OUT_OF_MEMORY;
-                }
+                char *s = stringValue(NPVARIANT_TO_STRING(args[0]));
+                if( !s )
+                    return INVOKERESULT_OUT_OF_MEMORY;
+
+                char *url = p_plugin->getAbsoluteURL(s);
+                if( url )
+                    free(s);
                 else
-                    return INVOKERESULT_NO_SUCH_METHOD;
+                    // problem with combining url, use argument
+                    url = s;
 
                 char *name = NULL;