QML/JS: fix improbable nullptr deref in possible future use.
The ast parameter cannot be null, because the only use checks for it not to be null. However, if it would ever be re-used somewhere else, the logic is plain wrong. Clarification by an assert makes it clear what the intent is. Pointed out by the clang static analyzer. Change-Id: I2c8cba5e5847fc1f92c10021109c55ff8ccd58c4 Reviewed-by: Fawzi Mohamed <firstname.lastname@example.org>