You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/06 17:10:41 UTC

[jira] [Commented] (TINKERPOP-1666) NPE in FileSandboxExtension if staticVariableTypes is empty in supplied YAML file

    [ https://issues.apache.org/jira/browse/TINKERPOP-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15959323#comment-15959323 ] 

ASF GitHub Bot commented on TINKERPOP-1666:
-------------------------------------------

GitHub user dpitera opened a pull request:

    https://github.com/apache/tinkerpop/pull/597

    TINKERPOP-1666 YAML file supplied to FileSandboxExtension can have empty staticVariableTypes

    Check if variable is null to avoid NPE
    
    If staticVariableTypes is an empty list in the YAML file, then we throw
    an NPE by trying to run collectEntries() on a null object or trying to
    run containsKey() on a null object.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dpitera/tinkerpop TINKERPOP-1666

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/597.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #597
    
----

----


> NPE in FileSandboxExtension if staticVariableTypes is empty in supplied YAML file
> ---------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1666
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1666
>             Project: TinkerPop
>          Issue Type: Bug
>    Affects Versions: 3.2.4
>            Reporter: David Pitera
>            Priority: Minor
>             Fix For: 3.2.4
>
>
> Currently, we have code that assumes that this variable is not empty in the supplied YAML file:
> 1. https://github.com/apache/tinkerpop/blob/tp32/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/jsr223/customizer/FileSandboxExtension.groovy#L66 (We get an NPE if we call collectEntries() on a null object)
> 2. https://github.com/apache/tinkerpop/blob/tp32/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/jsr223/customizer/AbstractSandboxExtension.groovy#L54 (need to check if staticVariableTyping is null or we throw NPE trying to call containsKey() on a null object)
> I propose to add some null checks here so that users who do not wish to statically type any variables can now do so.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)