Permalink
Browse files

Nicer exception for shadowOf(null).

  • Loading branch information...
1 parent 51ce1df commit 8a7a3d2753952ba049a384d51ec71bed2c7a8ff6 @xian xian committed Nov 24, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/com/xtremelabs/robolectric/ShadowWrangler.java
@@ -200,7 +200,7 @@ private Field getShadowField(Object instance) {
public Object shadowOf(Object instance) {
if (instance == null) {
- throw new RuntimeException("no instance for which to get a shadow");
+ throw new NullPointerException("can't get a shadow for null");
}
Field field = getShadowField(instance);
return readField(instance, field);

0 comments on commit 8a7a3d2

Please sign in to comment.