fixes a 'null is not an object in appframework.js' exception

I've got this exception in my app. This patch fixes it and should not break anything.

Best regards
dom