Handles the case where the triplet has not been created when calling build. This happens if no values are added to the matrix, i.e. a sparse matrix of zeros.