is `WeakReference<Entity?>` more proper than...
# announcements
s
is
WeakReference<Entity?>
more proper than
WeakReference<Entity>
. If I had to guess, I'd say it will always NPE after GC
d
get
for
WeakReference<T>
returns
T?
, so
WeakReference<Entity>
would be correct in your case,
get
would then return
Entity?
.
s
Oh, strange. That must be a built-in exception, right?
d
I am not quite sure where it gets the nullable information from here, yeah.
👍 1
k
yeah,
get()
on WeakReference doesn't have a
@Nullable
annotation but still returns
T?
. Maybe it's hardcoded into the compiler or something