Skip to content

Commit

Permalink
fix 'LENGTH or similar applied to NULL object'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengxwen committed Nov 3, 2017
1 parent 7450305 commit 8fb7cba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: SNPRelate
Type: Package
Title: Parallel Computing Toolset for Relatedness and Principal Component
Analysis of SNP Data
Version: 1.12.0
Date: 2017-10-31
Version: 1.12.1
Date: 2017-11-02
Depends: R (>= 2.15), gdsfmt (>= 1.8.3)
LinkingTo: gdsfmt
Suggests: parallel, RUnit, knitr, MASS, BiocGenerics
Expand Down
8 changes: 6 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
CHANGES IN VERSION 1.11.0-1.11.2
CHANGES IN VERSION 1.12.1
-------------------------

o the version number was bumped for the Bioconductor release version 3.5
o fix an issue in C codes 'LENGTH or similar applied to NULL object'


CHANGES IN VERSION 1.12.0
-------------------------

o new arguments 'with.sample.id' and 'with.snp.id' in `snpgdsSNPRateFreq()`

Expand Down
5 changes: 3 additions & 2 deletions src/ConvToGDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ COREARRAY_DLL_EXPORT SEXP gnrParseVCF4(SEXP vcf_fn, SEXP gds_root,

// chr prefix
vector<string> ChrPref;
for (int i=0; i < XLENGTH(ChrPrefix); i++)
const int n_chr_prefix = !Rf_isNull(ChrPrefix) ? XLENGTH(ChrPrefix) : 0;
for (int i=0; i < n_chr_prefix; i++)
ChrPref.push_back(CHAR(STRING_ELT(ChrPrefix, i)));


Expand Down Expand Up @@ -752,7 +753,7 @@ COREARRAY_DLL_EXPORT SEXP gnrParseVCF4(SEXP vcf_fn, SEXP gds_root,

string sCHROM, sPOS, sID, sREF, sALT;
vector<string> AlleleList;
R_xlen_t AlleleCount = XLENGTH(RefAllele);
R_xlen_t AlleleCount = !Rf_isNull(RefAllele) ? XLENGTH(RefAllele) : 0;

while (!RL.IfEnd())
{
Expand Down

0 comments on commit 8fb7cba

Please sign in to comment.