Fix filebrowser crash.

This way it doesn't need to rely on a context from an outer class and ensures it works no matter where it's used (ie. if moved around in the future).
Fixes a stupid oversight that is entirely my fault.