Skip to content
Permalink
Browse files
Eventually catch any exception thrown when instantiating a snappy::By…
…teArraySource
  • Loading branch information
fdmanana committed May 2, 2011
1 parent 7b4dc59 commit d0b0e5214ef1f80f54c33458d55da5ce7888d374
Showing 1 changed file with 2 additions and 3 deletions.
@@ -83,10 +83,9 @@ extern "C" {
return enif_make_badarg(env);
}

snappy::ByteArraySource source(reinterpret_cast<const char *>(input.data),
input.size);

try {
snappy::ByteArraySource source(reinterpret_cast<const char *>(input.data),
input.size);
SnappyNifSink sink(env);

snappy::Compress(&source, &sink);

0 comments on commit d0b0e52

Please sign in to comment.