         @_group = @_collection
         delete @_collection
         @_items = Zotero.Items.getAll(false, @_group.libraryID)
+        throw new Error('Cannot export empty group library') unless @_items
 
       # regular behavior for non-BBT translators, or if translating to string
       header = Zotero.BetterBibTeX.translators[translatorID]

Zotero.BetterBibTeX.flash = (title, body) ->
  progressWin = new Zotero.ProgressWindow()
  progressWin.changeHeadline(title)
  progressWin.addLines((if Array.isArray(body) then body else body.split("\n")))
  progressWin.startCloseTimer()


  itemGroup = zoteroPane.collectionsView._getItemAtRow(zoteroPane.collectionsView.selection.currentIndex)
  return unless itemGroup.isGroup()

  group = Zotero.Groups.get(itemGroup.ref.id)
  if !Zotero.Items.getAll(false, group.libraryID)
    @flash('Cannot export empty group')
    return

  exporter = new Zotero_File_Exporter()
  exporter.collection = group
  exporter.name = group.name
  exporter.save()

class Zotero.BetterBibTeX.XmlNode
