#vulnerable code 
                                @Override
    public String serialize(String data) {
        try {
            AbiBin abiBin = new AbiBin();
            JSONObject res = abiBin.request(RequestParams.of(netParams, () -> data));
            return res.getString("binargs");
        } catch (JSONException ex) {
            throw new IllegalArgumentException(String.format("Invalid json \"%s\" passed in.", data), ex);
        } catch (ApiResponseException ex) {
            throw new AbiSerialisationFailureException(ex.getRaw().toString(), ex);
        }
    } 
                            #location 10 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public String serialize(String data) {
        try {
            AbiBin abiBin = new AbiBin();
            JSONObject res = abiBin.request(RequestParams.of(netParams, () -> data));
            return res.getString("binargs");
        } catch (JSONException ex) {
            throw new IllegalArgumentException(String.format("Invalid json \"%s\" passed in.", data), ex);
        } catch (ApiResponseException ex) {
            throw new AbiSerialisationFailureException("Failed to serialize via node", ex);
        }
    }