Merge pull request #10 from schungx/patch-1
Avoid exception when object.user is nil
This commit is contained in:
commit
e77cf95a58
|
@ -49,8 +49,8 @@ after_initialize do
|
||||||
def excerpt
|
def excerpt
|
||||||
Post.excerpt(object.cooked, 70)
|
Post.excerpt(object.cooked, 70)
|
||||||
end
|
end
|
||||||
def username; object.user.username; end
|
def username; object.user && object.user.username; end
|
||||||
def avatar_template; object.user.avatar_template; end
|
def avatar_template; object.user && object.user.avatar_template; end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Run a data explorer query on the currently connected database.
|
# Run a data explorer query on the currently connected database.
|
||||||
|
|
Loading…
Reference in New Issue