Repository: wicket Updated Branches: refs/heads/wicket-7.x 0bcc14f21 -> f74c7a344
Improve the exception message when trying to set a model object on a component without a model Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f74c7a34 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f74c7a34 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f74c7a34 Branch: refs/heads/wicket-7.x Commit: f74c7a344ebc7ff77390d309f760687f966d0426 Parents: 0bcc14f Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Thu Apr 21 23:23:10 2016 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Thu Apr 21 23:24:11 2016 +0200 ---------------------------------------------------------------------- wicket-core/src/main/java/org/apache/wicket/Component.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/f74c7a34/wicket-core/src/main/java/org/apache/wicket/Component.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index 2c22cee..7d412d8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -3066,7 +3066,9 @@ public abstract class Component if (model == null) { throw new IllegalStateException( - "Attempt to set model object on null model of component: " + getPageRelativePath()); + "Attempt to set a model object on a component without a model! " + + "Either pass an IModel to the constructor or use #setDefaultModel(new SomeModel(object)). " + + "Component: " + getPageRelativePath()); } // Check authorization
