Panelbar Plugin breaks with PDF

@distantnative Panelbar (version 2.3.1) breaks on a page that has PDF files and images, (in my case it was a PNG file) attached to it. If i delete the PDF, the page loads fine with the panel bar at the top. This particular site is running Kirby 2.4.1.

Error thrown:

Undefined index: image

Offending file:

panel-bar/elements/files/templates/list.php

Offending line of code (line 6):

 <div class="panelBar-files__image" <?php e($item['type'] === 'image' and isset($item['image']), 'style="background-image:url(' . $item['image'] . ');"') ?>>

Should be easy enough to reproduce. Its trying to list the images in the panelbar dropdown, but seems to throw a hissy if theres a PDF in the mix.

Temporary fix is to go into Panelbar configuration page and untick files.

You can’t use the e() or ecco() helpers in this context, i.e. checking if a variable or index exists. Use a ternary operator or an if statement.