fix #458 error when no skin and no widgets loaded

Due to a bug in the code delivered in 59e9ba72a65c810df7935c5a1a4195365e44d233 (pull request #427), when no skin and no widgets were loaded, JavaScript errors were thrown due to nullpointer exception.