Merge "Fix runtime exception when cachedDevice is null"