Does the static pages plugin work with localization when using database templates?

Hello, maybe a niche question here but I’m setting up a multisite for localization and adding content to pages using the static pages plugin. All works well when using the filesystem to save templates, but when using database-driven themes I get an error when visiting the page.

The error is Error: Call to a member function getBaseFileName() on null in /var/www/vhost/my-theme/plugins/rainlab/pages/classes/PageList.php:53.

I can get it working if I modify the Pages plugin code by updating getPageTree to skip the cache within the buildMenuTree function of RainLab\Pages\Classes\Page but of course I dont want to be doing that.