By Paranoid: Floating window Fix possible NPE

From: https://gerrit.paranoidandroid.co/#/c/4409/

Also removed some trailing whitespaces and
unnecessary empty lines

Change-Id: Ibd85f6c0f6e5a3d2ceb461399a6642103e867fcd