brendan-duncan/archive

[BUG] The method 'writeBytes' was called on null

Closed this issue · 1 comments

This is the error I get in the console:

Unhandled exception:
NoSuchMethodError: The method 'writeBytes' was called on null.
Receiver: null
Tried calling: writeBytes(Uint8Array)

This is the only code that I'm calling from your library:

TarFileEncoder()
    ..tarDirectory(
      Directory('compressable'),
      filename: 'compressed.tar.gz',
      compression: 1, // for GZIP compression
    )
    ..close();

As far as I can see, the outcome is still correct.

It's not the cleanest API. tarDirectory already calls close. I'll add a check to keep it from trying to close it twice.